Commit 882ee7fb authored by Eli Friedman's avatar Eli Friedman
Browse files

Fix buildbot regression from 9c4baf51.

Apparently ScalarEvolution::isImpliedCond tries to truncate a pointer in
some obscure cases. Guard the code with a check for pointers.
parent db4c2582
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10581,7 +10581,7 @@ bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
    // For unsigned and equality predicates, try to prove that both found
    // operands fit into narrow unsigned range. If so, try to prove facts in
    // narrow types.
    if (!CmpInst::isSigned(FoundPred)) {
    if (!CmpInst::isSigned(FoundPred) && !FoundLHS->getType()->isPointerTy()) {
      auto *NarrowType = LHS->getType();
      auto *WideType = FoundLHS->getType();
      auto BitWidth = getTypeSizeInBits(NarrowType);