aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 2364208..dc252a2 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -670,6 +670,14 @@ static void computeKnownBitsFromAssume(const Value *V, KnownBits &Known,
unsigned BitWidth = Known.getBitWidth();
+ // Refine Known set if the pointer alignment is set by assume bundles.
+ if (V->getType()->isPointerTy()) {
+ if (RetainedKnowledge RK = getKnowledgeValidInContext(
+ V, {Attribute::Alignment}, Q.CxtI, Q.DT, Q.AC)) {
+ Known.Zero.setLowBits(Log2_32(RK.ArgValue));
+ }
+ }
+
// Note that the patterns below need to be kept in sync with the code
// in AssumptionCache::updateAffectedValues.