Index: llvm/include/llvm/Analysis/ValueTracking.h =================================================================== --- llvm/include/llvm/Analysis/ValueTracking.h +++ llvm/include/llvm/Analysis/ValueTracking.h @@ -809,7 +809,8 @@ /// assume intrinsic, I, at the point in the control-flow identified by the /// context instruction, CxtI. bool isValidAssumeForContext(const Instruction *I, const Instruction *CxtI, - const DominatorTree *DT = nullptr); + const DominatorTree *DT = nullptr, + bool AllowEphemeral = false); enum class OverflowResult { /// Always overflows in the direction of signed/unsigned min value. Index: llvm/lib/Analysis/ScalarEvolution.cpp =================================================================== --- llvm/lib/Analysis/ScalarEvolution.cpp +++ llvm/lib/Analysis/ScalarEvolution.cpp @@ -6865,6 +6865,13 @@ ConservativeResult = ConservativeResult.difference(Disallowed); } + if (U->getType()->isIntOrIntVectorTy()) { + ConstantRange Range = computeConstantRange( + U->getValue(), SignHint == ScalarEvolution::HINT_RANGE_SIGNED, true, + &AC, nullptr, &DT); + ConservativeResult = ConservativeResult.intersectWith(Range, RangeType); + } + return setRange(U, SignHint, std::move(ConservativeResult)); } case scCouldNotCompute: Index: llvm/lib/Analysis/ValueTracking.cpp =================================================================== --- llvm/lib/Analysis/ValueTracking.cpp +++ llvm/lib/Analysis/ValueTracking.cpp @@ -95,6 +95,14 @@ return DL.getPointerTypeSizeInBits(Ty); } +static const Instruction *getArgCxtI(const Argument *A) { + if (!A) + return nullptr; + + const BasicBlock &B = A->getParent()->getEntryBlock(); + return B.empty() ? nullptr : &B.front(); +} + // Given the provided Value and, potentially, a context instruction, return // the preferred context instruction (if any). static const Instruction *safeCxtI(const Value *V, const Instruction *CxtI) { @@ -108,6 +116,10 @@ if (CxtI && CxtI->getParent()) return CxtI; + CxtI = getArgCxtI(dyn_cast(V)); + if (CxtI && CxtI->getParent()) + return CxtI; + return nullptr; } @@ -126,6 +138,14 @@ if (CxtI && CxtI->getParent()) return CxtI; + CxtI = getArgCxtI(dyn_cast(V1)); + if (CxtI && CxtI->getParent()) + return CxtI; + + CxtI = getArgCxtI(dyn_cast(V2)); + if (CxtI && CxtI->getParent()) + return CxtI; + return nullptr; } @@ -511,7 +531,8 @@ bool llvm::isValidAssumeForContext(const Instruction *Inv, const Instruction *CxtI, - const DominatorTree *DT) { + const DominatorTree *DT, + bool AllowEphemeral) { // There are two restrictions on the use of an assume: // 1. The assume must dominate the context (or the control flow must // reach the assume whenever it reaches the context). @@ -542,7 +563,7 @@ if (!isGuaranteedToTransferExecutionToSuccessor(Range, 15)) return false; - return !isEphemeralValueOf(Inv, CxtI); + return AllowEphemeral || !isEphemeralValueOf(Inv, CxtI); } // Inv and CxtI are in different blocks. @@ -8707,7 +8728,7 @@ assert(I->getCalledFunction()->getIntrinsicID() == Intrinsic::assume && "must be an assume intrinsic"); - if (!isValidAssumeForContext(I, CtxI, DT)) + if (!isValidAssumeForContext(I, CtxI, DT, isa(V))) continue; Value *Arg = I->getArgOperand(0); ICmpInst *Cmp = dyn_cast(Arg); Index: llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll =================================================================== --- llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll +++ llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll @@ -414,7 +414,7 @@ ; PTR64_IDX64-NEXT: %ii = sext i32 %i to i64 ; PTR64_IDX64-NEXT: --> (sext i32 {1,+,1}<%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32)) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) ; PTR64_IDX64-NEXT: %div = sdiv i64 55555, %ii -; PTR64_IDX64-NEXT: --> %div U: full-set S: full-set +; PTR64_IDX64-NEXT: --> %div U: [-55555,55556) S: [-55555,55556) ; PTR64_IDX64-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] ; PTR64_IDX64-NEXT: --> {1,+,1}<%for.body> U: [1,0) S: [1,0) Exits: (-1 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32)) LoopDispositions: { %for.body: Computable } ; PTR64_IDX64-NEXT: %inc = add nuw i32 %i, 1 @@ -432,7 +432,7 @@ ; PTR64_IDX32-NEXT: %ii = sext i32 %i to i64 ; PTR64_IDX32-NEXT: --> (sext i32 {1,+,1}<%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + ptrtoint (ptr @sext_like_noop to i32)) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) ; PTR64_IDX32-NEXT: %div = sdiv i64 55555, %ii -; PTR64_IDX32-NEXT: --> %div U: full-set S: full-set +; PTR64_IDX32-NEXT: --> %div U: [-55555,55556) S: [-55555,55556) ; PTR64_IDX32-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] ; PTR64_IDX32-NEXT: --> {1,+,1}<%for.body> U: [1,0) S: [1,0) Exits: (-1 + ptrtoint (ptr @sext_like_noop to i32)) LoopDispositions: { %for.body: Computable } ; PTR64_IDX32-NEXT: %inc = add nuw i32 %i, 1 @@ -450,7 +450,7 @@ ; PTR16_IDX16-NEXT: %ii = sext i32 %i to i64 ; PTR16_IDX16-NEXT: --> (sext i32 {1,+,1}<%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i64)) U: [-1,65535) S: [-1,65535) ; PTR16_IDX16-NEXT: %div = sdiv i64 55555, %ii -; PTR16_IDX16-NEXT: --> %div U: full-set S: full-set +; PTR16_IDX16-NEXT: --> %div U: [-55555,55556) S: [-55555,55556) ; PTR16_IDX16-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] ; PTR16_IDX16-NEXT: --> {1,+,1}<%for.body> U: [1,0) S: [1,0) Exits: (-1 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32)) LoopDispositions: { %for.body: Computable } ; PTR16_IDX16-NEXT: %inc = add nuw i32 %i, 1 @@ -468,7 +468,7 @@ ; PTR16_IDX32-NEXT: %ii = sext i32 %i to i64 ; PTR16_IDX32-NEXT: --> (sext i32 {1,+,1}<%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i32 ptrtoint (ptr @sext_like_noop to i32) to i64)) U: [-1,65535) S: [-1,65535) ; PTR16_IDX32-NEXT: %div = sdiv i64 55555, %ii -; PTR16_IDX32-NEXT: --> %div U: full-set S: full-set +; PTR16_IDX32-NEXT: --> %div U: [-55555,55556) S: [-55555,55556) ; PTR16_IDX32-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] ; PTR16_IDX32-NEXT: --> {1,+,1}<%for.body> U: [1,0) S: [1,0) Exits: (-1 + ptrtoint (ptr @sext_like_noop to i32)) LoopDispositions: { %for.body: Computable } ; PTR16_IDX32-NEXT: %inc = add nuw i32 %i, 1 Index: llvm/test/Analysis/ScalarEvolution/ranges.ll =================================================================== --- llvm/test/Analysis/ScalarEvolution/ranges.ll +++ llvm/test/Analysis/ScalarEvolution/ranges.ll @@ -43,7 +43,7 @@ ; CHECK-LABEL: 'shl' ; CHECK-NEXT: Classifying expressions for: @shl ; CHECK-NEXT: %res = shl i32 %a, 2 -; CHECK-NEXT: --> (4 * %a) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %a) U: [0,4093) S: [0,4093) ; CHECK-NEXT: Determining loop execution counts for: @shl ; %res = shl i32 %a, 2 @@ -56,7 +56,7 @@ ; CHECK-LABEL: 'lshr' ; CHECK-NEXT: Classifying expressions for: @lshr ; CHECK-NEXT: %res = lshr i32 %a, 31 -; CHECK-NEXT: --> (%a /u -2147483648) U: [0,2) S: [0,2) +; CHECK-NEXT: --> (%a /u -2147483648) U: [0,1) S: [0,1) ; CHECK-NEXT: Determining loop execution counts for: @lshr ; %res = lshr i32 %a, 31 @@ -70,7 +70,7 @@ ; CHECK-LABEL: 'udiv' ; CHECK-NEXT: Classifying expressions for: @udiv ; CHECK-NEXT: %res = udiv i32 %a, -2147483648 -; CHECK-NEXT: --> (%a /u -2147483648) U: [0,2) S: [0,2) +; CHECK-NEXT: --> (%a /u -2147483648) U: [0,1) S: [0,1) ; CHECK-NEXT: Determining loop execution counts for: @udiv ; %res = udiv i32 %a, 2147483648 @@ -83,7 +83,7 @@ ; CHECK-LABEL: 'sext' ; CHECK-NEXT: Classifying expressions for: @sext ; CHECK-NEXT: %res = sext i8 %a to i64 -; CHECK-NEXT: --> (sext i8 %a to i64) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (zext i8 %a to i64) U: [0,128) S: [0,128) ; CHECK-NEXT: Determining loop execution counts for: @sext ; %res = sext i8 %a to i64 @@ -96,7 +96,7 @@ ; CHECK-LABEL: 'zext' ; CHECK-NEXT: Classifying expressions for: @zext ; CHECK-NEXT: %res = zext i8 %a to i64 -; CHECK-NEXT: --> (zext i8 %a to i64) U: [0,256) S: [0,256) +; CHECK-NEXT: --> (zext i8 %a to i64) U: [0,128) S: [0,128) ; CHECK-NEXT: Determining loop execution counts for: @zext ; %res = zext i8 %a to i64 Index: llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll =================================================================== --- llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll +++ llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll @@ -151,14 +151,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 ; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_sgt_5 -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 2147483646 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; @@ -187,14 +187,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 ; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_sgt_5_order_swapped -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 2147483646 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; @@ -294,14 +294,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 ; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_sge_5 -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 2147483646 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; @@ -329,14 +329,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 ; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_sge_5_order_swapped -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 2147483646 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; @@ -400,14 +400,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,65535) S: [0,65535) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,65536) S: [1,65536) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_upper_lower_bounds -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 65534 +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; @@ -437,14 +437,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,65535) S: [0,65535) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,65536) S: [1,65536) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_upper_lower_bounds_swapped1 -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 65534 +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; @@ -474,14 +474,14 @@ ; CHECK-NEXT: %u = urem i32 %num, 4 ; CHECK-NEXT: --> (zext i2 (trunc i32 %num to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %i.010 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,65535) S: [0,65535) Exits: (-1 + %num) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.010, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,65536) S: [1,65536) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_upper_lower_bounds_swapped2 -; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 -; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) -; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is 65534 +; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is (-1 + %num) +; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (-1 + %num) ; CHECK-NEXT: Predicates: ; CHECK: Loop %for.body: Trip multiple is 4 ; Index: llvm/unittests/Analysis/ValueTrackingTest.cpp =================================================================== --- llvm/unittests/Analysis/ValueTrackingTest.cpp +++ llvm/unittests/Analysis/ValueTrackingTest.cpp @@ -2961,7 +2961,7 @@ Value *Stride = &*F->arg_begin(); Instruction *GT2 = &findInstructionByName(F, "gt.2"); ConstantRange CR = computeConstantRange(Stride, false, true, &AC, GT2); - EXPECT_EQ(5, CR.getLower()); + EXPECT_EQ(50, CR.getLower()); EXPECT_EQ(0, CR.getUpper()); Instruction *I = &findInstructionByName(F, "stride.plus.one");