Skip to content

Commit 9e63247

Browse files
committed
fixup! [ValueTracking] Handle range assume bundles in isKnownNonZero
1 parent 3ef8137 commit 9e63247

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -596,17 +596,17 @@ static bool isKnownNonZeroFromAssume(const Value *V, const SimplifyQuery &Q) {
596596

597597
if (Elem.Index != AssumptionCache::ExprResultIdx) {
598598
if (V->getType()->isPointerTy()) {
599-
if (RetainedKnowledge RK = getKnowledgeFromBundle(
600-
*I, I->bundle_op_info_begin()[Elem.Index])) {
601-
if (RK.WasOn == V &&
602-
(RK.AttrKind == Attribute::NonNull ||
603-
(RK.AttrKind == Attribute::Dereferenceable &&
599+
if (RetainedKnowledge RK = getKnowledgeFromBundle(
600+
*I, I->bundle_op_info_begin()[Elem.Index])) {
601+
if (RK.WasOn == V &&
602+
(RK.AttrKind == Attribute::NonNull ||
603+
(RK.AttrKind == Attribute::Dereferenceable &&
604604
!NullPointerIsDefined(
605605
Q.CxtI->getFunction(),
606-
V->getType()->getPointerAddressSpace()))) &&
607-
isValidAssumeForContext(I, Q.CxtI, Q.DT))
608-
return true;
609-
}
606+
V->getType()->getPointerAddressSpace()))) &&
607+
isValidAssumeForContext(I, Q.CxtI, Q.DT))
608+
return true;
609+
}
610610
} else if (V->getType()->isIntOrIntVectorTy()) {
611611
if (std::optional<ConstantRange> Range =
612612
getRangeFromBundle(*I, I->bundle_op_info_begin()[Elem.Index]))

0 commit comments

Comments
 (0)