Skip to content

Commit 882ee7f

Browse files
committed
Fix buildbot regression from 9c4baf5.
Apparently ScalarEvolution::isImpliedCond tries to truncate a pointer in some obscure cases. Guard the code with a check for pointers.
1 parent db4c258 commit 882ee7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10581,7 +10581,7 @@ bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
1058110581
// For unsigned and equality predicates, try to prove that both found
1058210582
// operands fit into narrow unsigned range. If so, try to prove facts in
1058310583
// narrow types.
10584-
if (!CmpInst::isSigned(FoundPred)) {
10584+
if (!CmpInst::isSigned(FoundPred) && !FoundLHS->getType()->isPointerTy()) {
1058510585
auto *NarrowType = LHS->getType();
1058610586
auto *WideType = FoundLHS->getType();
1058710587
auto BitWidth = getTypeSizeInBits(NarrowType);

0 commit comments

Comments
 (0)