diff --git a/llvm/include/llvm/IR/ConstantRange.h b/llvm/include/llvm/IR/ConstantRange.h --- a/llvm/include/llvm/IR/ConstantRange.h +++ b/llvm/include/llvm/IR/ConstantRange.h @@ -562,7 +562,7 @@ KnownBits toKnownBits() const; /// Print out the bounds to a stream. - void print(raw_ostream &OS) const; + void print(raw_ostream &OS, bool IsSigned = true) const; /// Allow printing from a debugger easily. void dump() const; diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -13613,7 +13613,7 @@ SV->print(OS); if (!isa(SV)) { OS << " U: "; - SE.getUnsignedRange(SV).print(OS); + SE.getUnsignedRange(SV).print(OS, /*IsSigned=*/false); OS << " S: "; SE.getSignedRange(SV).print(OS); } @@ -13626,7 +13626,7 @@ AtUse->print(OS); if (!isa(AtUse)) { OS << " U: "; - SE.getUnsignedRange(AtUse).print(OS); + SE.getUnsignedRange(AtUse).print(OS, /*IsSigned=*/false); OS << " S: "; SE.getSignedRange(AtUse).print(OS); } diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp --- a/llvm/lib/IR/ConstantRange.cpp +++ b/llvm/lib/IR/ConstantRange.cpp @@ -1825,13 +1825,18 @@ return OverflowResult::NeverOverflows; } -void ConstantRange::print(raw_ostream &OS) const { +void ConstantRange::print(raw_ostream &OS, bool IsSigned) const { if (isFullSet()) OS << "full-set"; else if (isEmptySet()) OS << "empty-set"; - else - OS << "[" << Lower << "," << Upper << ")"; + else { + OS << "["; + Lower.print(OS, IsSigned); + OS << ","; + Upper.print(OS, IsSigned); + OS << ")"; + } } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) diff --git a/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll b/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll --- a/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll +++ b/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll @@ -9,9 +9,9 @@ ; CHECK-LABEL: 'foo' ; CHECK-NEXT: Classifying expressions for: @foo ; CHECK-NEXT: %iv.i = phi i64 [ -5, %entry ], [ %iv.next.i, %loop ] -; CHECK-NEXT: --> -5 U: [-5,-4) S: [-5,-4) Exits: -5 LoopDispositions: { %loop: Invariant } +; CHECK-NEXT: --> -5 U: [18446744073709551611,18446744073709551612) S: [-5,-4) Exits: -5 LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: %iv.next.i = add nsw i64 %iv.i, 0 -; CHECK-NEXT: --> -5 U: [-5,-4) S: [-5,-4) Exits: -5 LoopDispositions: { %loop: Invariant } +; CHECK-NEXT: --> -5 U: [18446744073709551611,18446744073709551612) S: [-5,-4) Exits: -5 LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: Determining loop execution counts for: @foo ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. diff --git a/llvm/test/Analysis/ScalarEvolution/add-expr-pointer-operand-sorting.ll b/llvm/test/Analysis/ScalarEvolution/add-expr-pointer-operand-sorting.ll --- a/llvm/test/Analysis/ScalarEvolution/add-expr-pointer-operand-sorting.ll +++ b/llvm/test/Analysis/ScalarEvolution/add-expr-pointer-operand-sorting.ll @@ -26,7 +26,7 @@ ; CHECK-NEXT: %f.0 = phi i32 [ %base, %entry ], [ %inc, %for.cond ] ; CHECK-NEXT: --> {%base,+,1}<%for.cond> U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %idxprom = sext i32 %f.0 to i64 -; CHECK-NEXT: --> {(sext i32 %base to i64),+,1}<%for.cond> U: [-2147483648,-9223372036854775808) S: [-2147483648,-9223372036854775808) Exits: <> LoopDispositions: { %for.cond: Computable } +; CHECK-NEXT: --> {(sext i32 %base to i64),+,1}<%for.cond> U: [18446744071562067968,9223372036854775808) S: [-2147483648,-9223372036854775808) Exits: <> LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %arrayidx = getelementptr inbounds [1 x [1 x i8]], ptr %e, i64 0, i64 %idxprom ; CHECK-NEXT: --> {((sext i32 %base to i64) + %e),+,1}<%for.cond> U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %1 = load ptr, ptr @c, align 8 @@ -36,13 +36,13 @@ ; CHECK-NEXT: %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, ptrtoint (ptr @b to i64) ; CHECK-NEXT: --> ((-1 * (ptrtoint ptr @b to i64)) + (ptrtoint ptr %1 to i64)) U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %sub.ptr.div = sdiv exact i64 %sub.ptr.sub, 4 -; CHECK-NEXT: --> %sub.ptr.div U: [-2305843009213693952,2305843009213693952) S: [-2305843009213693952,2305843009213693952) Exits: <> LoopDispositions: { %for.cond: Variant } +; CHECK-NEXT: --> %sub.ptr.div U: [16140901064495857664,2305843009213693952) S: [-2305843009213693952,2305843009213693952) Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %arrayidx1 = getelementptr inbounds [1 x i8], ptr %arrayidx, i64 0, i64 %sub.ptr.div ; CHECK-NEXT: --> ({((sext i32 %base to i64) + %e),+,1}<%for.cond> + %sub.ptr.div) U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %2 = load i8, ptr %arrayidx1, align 1 ; CHECK-NEXT: --> %2 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %conv = sext i8 %2 to i32 -; CHECK-NEXT: --> (sext i8 %2 to i32) U: [-128,128) S: [-128,128) Exits: <> LoopDispositions: { %for.cond: Variant } +; CHECK-NEXT: --> (sext i8 %2 to i32) U: [4294967168,128) S: [-128,128) Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %inc = add nsw i32 %f.0, 1 ; CHECK-NEXT: --> {(1 + %base),+,1}<%for.cond> U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: Determining loop execution counts for: @d diff --git a/llvm/test/Analysis/ScalarEvolution/add-like-or.ll b/llvm/test/Analysis/ScalarEvolution/add-like-or.ll --- a/llvm/test/Analysis/ScalarEvolution/add-like-or.ll +++ b/llvm/test/Analysis/ScalarEvolution/add-like-or.ll @@ -5,7 +5,7 @@ ; CHECK-LABEL: 'or-of-constant-with-no-common-bits-set' ; CHECK-NEXT: Classifying expressions for: @or-of-constant-with-no-common-bits-set ; CHECK-NEXT: %t0 = shl i8 %x, 2 -; CHECK-NEXT: --> (4 * %x) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (4 * %x) U: [0,253) S: [-128,125) ; CHECK-NEXT: %r = or i8 %t0, 3 ; CHECK-NEXT: --> (3 + (4 * %x)) U: [3,0) S: [-125,-128) ; CHECK-NEXT: Determining loop execution counts for: @or-of-constant-with-no-common-bits-set @@ -21,11 +21,11 @@ ; CHECK-NEXT: %i = load i32, ptr %arg1, align 4 ; CHECK-NEXT: --> %i U: full-set S: full-set ; CHECK-NEXT: %i2 = sext i32 %i to i64 -; CHECK-NEXT: --> (sext i32 %i to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %i to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %i3 = and i64 %arg, -16 -; CHECK-NEXT: --> (16 * (%arg /u 16)) U: [0,-15) S: [-9223372036854775808,9223372036854775793) +; CHECK-NEXT: --> (16 * (%arg /u 16)) U: [0,18446744073709551601) S: [-9223372036854775808,9223372036854775793) ; CHECK-NEXT: %i4 = or i64 1, %i3 -; CHECK-NEXT: --> (1 + (16 * (%arg /u 16))) U: [1,-14) S: [-9223372036854775807,9223372036854775794) +; CHECK-NEXT: --> (1 + (16 * (%arg /u 16))) U: [1,18446744073709551602) S: [-9223372036854775807,9223372036854775794) ; CHECK-NEXT: %i7 = phi i64 [ %i4, %bb ], [ %i8, %bb6 ] ; CHECK-NEXT: --> {(1 + (16 * (%arg /u 16))),+,1}<%bb6> U: full-set S: full-set Exits: ((sext i32 %i to i64) smax (1 + (16 * (%arg /u 16)))) LoopDispositions: { %bb6: Computable } ; CHECK-NEXT: %i8 = add i64 %i7, 1 diff --git a/llvm/test/Analysis/ScalarEvolution/addrec-computed-during-addrec-calculation.ll b/llvm/test/Analysis/ScalarEvolution/addrec-computed-during-addrec-calculation.ll --- a/llvm/test/Analysis/ScalarEvolution/addrec-computed-during-addrec-calculation.ll +++ b/llvm/test/Analysis/ScalarEvolution/addrec-computed-during-addrec-calculation.ll @@ -18,11 +18,11 @@ ; CHECK-NEXT: %v = load i32, ptr %p, align 4 ; CHECK-NEXT: --> %v U: full-set S: full-set Exits: <> LoopDispositions: { %loop2: Variant, %loop.header: Variant } ; CHECK-NEXT: %iv2.ext = sext i32 %iv2 to i64 -; CHECK-NEXT: --> (sext i32 {%iv,+,1}<%loop2> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %loop.header: Variant, %loop2: Computable, %loop3: Invariant } +; CHECK-NEXT: --> (sext i32 {%iv,+,1}<%loop2> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %loop.header: Variant, %loop2: Computable, %loop3: Invariant } ; CHECK-NEXT: %iv3 = phi i64 [ %iv2.ext, %loop2.end ], [ %iv3.next, %loop3 ] -; CHECK-NEXT: --> {(sext i32 {%iv,+,1}<%loop2> to i64),+,1}<%loop3> U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 {%iv,+,1}<%loop2> to i64) LoopDispositions: { %loop3: Computable, %loop.header: Variant } +; CHECK-NEXT: --> {(sext i32 {%iv,+,1}<%loop2> to i64),+,1}<%loop3> U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 {%iv,+,1}<%loop2> to i64) LoopDispositions: { %loop3: Computable, %loop.header: Variant } ; CHECK-NEXT: %iv3.next = add nsw i64 %iv3, 1 -; CHECK-NEXT: --> {(1 + (sext i32 {%iv,+,1}<%loop2> to i64)),+,1}<%loop3> U: [-2147483647,2147483649) S: [-2147483647,2147483649) Exits: (1 + (sext i32 {%iv,+,1}<%loop2> to i64)) LoopDispositions: { %loop3: Computable, %loop.header: Variant } +; CHECK-NEXT: --> {(1 + (sext i32 {%iv,+,1}<%loop2> to i64)),+,1}<%loop3> U: [18446744071562067969,2147483649) S: [-2147483647,2147483649) Exits: (1 + (sext i32 {%iv,+,1}<%loop2> to i64)) LoopDispositions: { %loop3: Computable, %loop.header: Variant } ; CHECK-NEXT: %iv.next = trunc i64 %iv3 to i32 ; CHECK-NEXT: --> {{\{}}{%iv,+,1}<%loop2>,+,1}<%loop3> U: full-set S: full-set --> {%iv,+,1}<%loop2> U: full-set S: full-set Exits: <> LoopDispositions: { %loop.header: Variant, %loop2: Variant, %loop3: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test diff --git a/llvm/test/Analysis/ScalarEvolution/ashr.ll b/llvm/test/Analysis/ScalarEvolution/ashr.ll --- a/llvm/test/Analysis/ScalarEvolution/ashr.ll +++ b/llvm/test/Analysis/ScalarEvolution/ashr.ll @@ -29,7 +29,7 @@ ; CHECK-LABEL: 't2' ; CHECK-NEXT: Classifying expressions for: @t2 ; CHECK-NEXT: %i0 = ashr i32 %x, 4 -; CHECK-NEXT: --> %i0 U: [-134217728,134217728) S: [-134217728,134217728) +; CHECK-NEXT: --> %i0 U: [4160749568,134217728) S: [-134217728,134217728) ; CHECK-NEXT: Determining loop execution counts for: @t2 ; %i0 = ashr i32 %x, 4 @@ -40,7 +40,7 @@ ; CHECK-LABEL: 't3' ; CHECK-NEXT: Classifying expressions for: @t3 ; CHECK-NEXT: %i0 = ashr exact i32 %x, 4 -; CHECK-NEXT: --> %i0 U: [-134217728,134217728) S: [-134217728,134217728) +; CHECK-NEXT: --> %i0 U: [4160749568,134217728) S: [-134217728,134217728) ; CHECK-NEXT: Determining loop execution counts for: @t3 ; %i0 = ashr exact i32 %x, 4 @@ -63,7 +63,7 @@ ; CHECK-LABEL: 't5' ; CHECK-NEXT: Classifying expressions for: @t5 ; CHECK-NEXT: %i0 = ashr exact i32 %x, 5 -; CHECK-NEXT: --> %i0 U: [-67108864,67108864) S: [-67108864,67108864) +; CHECK-NEXT: --> %i0 U: [4227858432,67108864) S: [-67108864,67108864) ; CHECK-NEXT: Determining loop execution counts for: @t5 ; %i0 = ashr exact i32 %x, 5 diff --git a/llvm/test/Analysis/ScalarEvolution/exact-exit-count-more-precise.ll b/llvm/test/Analysis/ScalarEvolution/exact-exit-count-more-precise.ll --- a/llvm/test/Analysis/ScalarEvolution/exact-exit-count-more-precise.ll +++ b/llvm/test/Analysis/ScalarEvolution/exact-exit-count-more-precise.ll @@ -43,11 +43,11 @@ ; CHECK-LABEL: 'test_or' ; CHECK-NEXT: Classifying expressions for: @test_or ; CHECK-NEXT: %indvars.iv = phi i64 [ -1, %BB ], [ -1, %0 ] -; CHECK-NEXT: --> -1 U: [-1,0) S: [-1,0) Exits: -1 LoopDispositions: { %BB: Invariant } +; CHECK-NEXT: --> -1 U: [18446744073709551615,0) S: [-1,0) Exits: -1 LoopDispositions: { %BB: Invariant } ; CHECK-NEXT: %sum.01 = phi i32 [ %2, %BB ], [ undef, %0 ] ; CHECK-NEXT: --> {undef,+,-1}<%BB> U: full-set S: full-set Exits: 0 LoopDispositions: { %BB: Computable } ; CHECK-NEXT: %1 = trunc i64 %indvars.iv to i32 -; CHECK-NEXT: --> -1 U: [-1,0) S: [-1,0) Exits: -1 LoopDispositions: { %BB: Invariant } +; CHECK-NEXT: --> -1 U: [4294967295,0) S: [-1,0) Exits: -1 LoopDispositions: { %BB: Invariant } ; CHECK-NEXT: %2 = add nsw i32 %1, %sum.01 ; CHECK-NEXT: --> {(-1 + undef),+,-1}<%BB> U: full-set S: full-set Exits: -1 LoopDispositions: { %BB: Computable } ; CHECK-NEXT: %B3 = add i32 %1, %2 diff --git a/llvm/test/Analysis/ScalarEvolution/ext_min_max.ll b/llvm/test/Analysis/ScalarEvolution/ext_min_max.ll --- a/llvm/test/Analysis/ScalarEvolution/ext_min_max.ll +++ b/llvm/test/Analysis/ScalarEvolution/ext_min_max.ll @@ -69,13 +69,13 @@ ; CHECK-NEXT: %smin_x_y = select i1 %cmp_x_y, i32 %x, i32 %y ; CHECK-NEXT: --> (%x smin %y) U: full-set S: full-set ; CHECK-NEXT: %sext_smin_x_y = sext i32 %smin_x_y to i64 -; CHECK-NEXT: --> (sext i32 (%x smin %y) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 (%x smin %y) to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %sext_x = sext i32 %x to i64 -; CHECK-NEXT: --> (sext i32 %x to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %x to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %sext_y = sext i32 %y to i64 -; CHECK-NEXT: --> (sext i32 %y to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %y to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %smin_sext_x_sext_y = select i1 %cmp_sext_x_sext_y, i64 %sext_x, i64 %sext_y -; CHECK-NEXT: --> ((sext i32 %x to i64) smin (sext i32 %y to i64)) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> ((sext i32 %x to i64) smin (sext i32 %y to i64)) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: Determining loop execution counts for: @test_smin ; %cmp_x_y = icmp slt i32 %x, %y @@ -99,13 +99,13 @@ ; CHECK-NEXT: %smax_x_y = select i1 %cmp_x_y, i32 %y, i32 %x ; CHECK-NEXT: --> (%x smax %y) U: full-set S: full-set ; CHECK-NEXT: %sext_smax_x_y = sext i32 %smax_x_y to i64 -; CHECK-NEXT: --> (sext i32 (%x smax %y) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 (%x smax %y) to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %sext_x = sext i32 %x to i64 -; CHECK-NEXT: --> (sext i32 %x to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %x to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %sext_y = sext i32 %y to i64 -; CHECK-NEXT: --> (sext i32 %y to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %y to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %smax_sext_x_sext_y = select i1 %cmp_sext_x_sext_y, i64 %sext_y, i64 %sext_x -; CHECK-NEXT: --> ((sext i32 %x to i64) smax (sext i32 %y to i64)) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> ((sext i32 %x to i64) smax (sext i32 %y to i64)) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: Determining loop execution counts for: @test_smax ; %cmp_x_y = icmp slt i32 %x, %y diff --git a/llvm/test/Analysis/ScalarEvolution/extract-highbits-sameconstmask.ll b/llvm/test/Analysis/ScalarEvolution/extract-highbits-sameconstmask.ll --- a/llvm/test/Analysis/ScalarEvolution/extract-highbits-sameconstmask.ll +++ b/llvm/test/Analysis/ScalarEvolution/extract-highbits-sameconstmask.ll @@ -8,7 +8,7 @@ ; CHECK-NEXT: %tmp1 = udiv i32 %val, 16 ; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: %tmp2 = mul i32 %tmp1, 16 -; CHECK-NEXT: --> (16 * (%val /u 16)) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * (%val /u 16)) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: Determining loop execution counts for: @div ; %tmp1 = udiv i32 %val, 16 @@ -20,9 +20,9 @@ ; CHECK-LABEL: 'sdiv' ; CHECK-NEXT: Classifying expressions for: @sdiv ; CHECK-NEXT: %tmp1 = sdiv i32 %val, 16 -; CHECK-NEXT: --> %tmp1 U: [-134217728,134217728) S: [-134217728,134217728) +; CHECK-NEXT: --> %tmp1 U: [4160749568,134217728) S: [-134217728,134217728) ; CHECK-NEXT: %tmp2 = mul i32 %tmp1, 16 -; CHECK-NEXT: --> (16 * %tmp1) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %tmp1) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: Determining loop execution counts for: @sdiv ; %tmp1 = sdiv i32 %val, 16 @@ -38,7 +38,7 @@ ; CHECK-LABEL: 'mask_b' ; CHECK-NEXT: Classifying expressions for: @mask_b ; CHECK-NEXT: %masked = and i32 %val, -16 -; CHECK-NEXT: --> (16 * (%val /u 16)) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * (%val /u 16)) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: Determining loop execution counts for: @mask_b ; %masked = and i32 %val, -16 @@ -51,7 +51,7 @@ ; CHECK-NEXT: %lowbitscleared = lshr i32 %val, 4 ; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: %masked = shl i32 %lowbitscleared, 4 -; CHECK-NEXT: --> (16 * (%val /u 16)) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * (%val /u 16)) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: Determining loop execution counts for: @mask_d ; %lowbitscleared = lshr i32 %val, 4 diff --git a/llvm/test/Analysis/ScalarEvolution/extract-highbits-variablemask.ll b/llvm/test/Analysis/ScalarEvolution/extract-highbits-variablemask.ll --- a/llvm/test/Analysis/ScalarEvolution/extract-highbits-variablemask.ll +++ b/llvm/test/Analysis/ScalarEvolution/extract-highbits-variablemask.ll @@ -8,9 +8,9 @@ ; CHECK-LABEL: 'div' ; CHECK-NEXT: Classifying expressions for: @div ; CHECK-NEXT: %tmp1 = udiv i32 %val, %num -; CHECK-NEXT: --> (%val /u %num) U: full-set S: full-set +; CHECK-NEXT: --> (%val /u %num) U: full-set S: full-set ; CHECK-NEXT: %tmp2 = mul i32 %tmp1, %num -; CHECK-NEXT: --> ((%val /u %num) * %num) U: full-set S: full-set +; CHECK-NEXT: --> ((%val /u %num) * %num) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @div ; %tmp1 = udiv i32 %val, %num @@ -22,9 +22,9 @@ ; CHECK-LABEL: 'sdiv' ; CHECK-NEXT: Classifying expressions for: @sdiv ; CHECK-NEXT: %tmp1 = sdiv i32 %val, %num -; CHECK-NEXT: --> %tmp1 U: full-set S: full-set +; CHECK-NEXT: --> %tmp1 U: full-set S: full-set ; CHECK-NEXT: %tmp2 = mul i32 %tmp1, %num -; CHECK-NEXT: --> (%num * %tmp1) U: full-set S: full-set +; CHECK-NEXT: --> (%num * %tmp1) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @sdiv ; %tmp1 = sdiv i32 %val, %num @@ -40,9 +40,9 @@ ; CHECK-LABEL: 'mask_b' ; CHECK-NEXT: Classifying expressions for: @mask_b ; CHECK-NEXT: %mask = shl i32 -1, %numlowbits -; CHECK-NEXT: --> %mask U: full-set S: full-set +; CHECK-NEXT: --> %mask U: full-set S: full-set ; CHECK-NEXT: %masked = and i32 %mask, %val -; CHECK-NEXT: --> %masked U: full-set S: full-set +; CHECK-NEXT: --> %masked U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mask_b ; %mask = shl i32 -1, %numlowbits @@ -54,11 +54,11 @@ ; CHECK-LABEL: 'mask_d' ; CHECK-NEXT: Classifying expressions for: @mask_d ; CHECK-NEXT: %numlowbits = sub i32 32, %lowbits -; CHECK-NEXT: --> (32 + (-1 * %lowbits)) U: full-set S: full-set +; CHECK-NEXT: --> (32 + (-1 * %lowbits)) U: full-set S: full-set ; CHECK-NEXT: %lowbitscleared = lshr i32 %val, %numlowbits -; CHECK-NEXT: --> %lowbitscleared U: full-set S: full-set +; CHECK-NEXT: --> %lowbitscleared U: full-set S: full-set ; CHECK-NEXT: %masked = shl i32 %lowbitscleared, %numlowbits -; CHECK-NEXT: --> %masked U: full-set S: full-set +; CHECK-NEXT: --> %masked U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mask_d ; %numlowbits = sub i32 32, %lowbits diff --git a/llvm/test/Analysis/ScalarEvolution/extract-lowbits-sameconstmask.ll b/llvm/test/Analysis/ScalarEvolution/extract-lowbits-sameconstmask.ll --- a/llvm/test/Analysis/ScalarEvolution/extract-lowbits-sameconstmask.ll +++ b/llvm/test/Analysis/ScalarEvolution/extract-lowbits-sameconstmask.ll @@ -6,9 +6,9 @@ ; CHECK-LABEL: 'mul' ; CHECK-NEXT: Classifying expressions for: @mul ; CHECK-NEXT: %tmp1 = mul i32 %val, 16 -; CHECK-NEXT: --> (16 * %val) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %val) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: %tmp2 = udiv i32 %tmp1, 16 -; CHECK-NEXT: --> ((16 * %val) /u 16) U: [0,268435456) S: [0,268435456) +; CHECK-NEXT: --> ((16 * %val) /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: Determining loop execution counts for: @mul ; %tmp1 = mul i32 %val, 16 @@ -26,7 +26,7 @@ ; CHECK-LABEL: 'mask_abc' ; CHECK-NEXT: Classifying expressions for: @mask_abc ; CHECK-NEXT: %masked = and i32 %val, 15 -; CHECK-NEXT: --> (zext i4 (trunc i32 %val to i4) to i32) U: [0,16) S: [0,16) +; CHECK-NEXT: --> (zext i4 (trunc i32 %val to i4) to i32) U: [0,16) S: [0,16) ; CHECK-NEXT: Determining loop execution counts for: @mask_abc ; %masked = and i32 %val, 15 @@ -37,9 +37,9 @@ ; CHECK-LABEL: 'mask_d' ; CHECK-NEXT: Classifying expressions for: @mask_d ; CHECK-NEXT: %highbitscleared = shl i32 %val, 4 -; CHECK-NEXT: --> (16 * %val) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %val) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: %masked = lshr i32 %highbitscleared, 4 -; CHECK-NEXT: --> ((16 * %val) /u 16) U: [0,268435456) S: [0,268435456) +; CHECK-NEXT: --> ((16 * %val) /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: Determining loop execution counts for: @mask_d ; %highbitscleared = shl i32 %val, 4 diff --git a/llvm/test/Analysis/ScalarEvolution/extract-lowbits-variablemask.ll b/llvm/test/Analysis/ScalarEvolution/extract-lowbits-variablemask.ll --- a/llvm/test/Analysis/ScalarEvolution/extract-lowbits-variablemask.ll +++ b/llvm/test/Analysis/ScalarEvolution/extract-lowbits-variablemask.ll @@ -8,9 +8,9 @@ ; CHECK-LABEL: 'mul' ; CHECK-NEXT: Classifying expressions for: @mul ; CHECK-NEXT: %tmp1 = mul i32 %val, %num -; CHECK-NEXT: --> (%val * %num) U: full-set S: full-set +; CHECK-NEXT: --> (%val * %num) U: full-set S: full-set ; CHECK-NEXT: %tmp2 = udiv i32 %tmp1, %num -; CHECK-NEXT: --> ((%val * %num) /u %num) U: full-set S: full-set +; CHECK-NEXT: --> ((%val * %num) /u %num) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mul ; %tmp1 = mul i32 %val, %num @@ -28,11 +28,11 @@ ; CHECK-LABEL: 'mask_a' ; CHECK-NEXT: Classifying expressions for: @mask_a ; CHECK-NEXT: %onebit = shl i32 1, %numlowbits -; CHECK-NEXT: --> %onebit U: full-set S: full-set +; CHECK-NEXT: --> %onebit U: full-set S: full-set ; CHECK-NEXT: %mask = add nsw i32 %onebit, -1 -; CHECK-NEXT: --> (-1 + %onebit) U: full-set S: full-set +; CHECK-NEXT: --> (-1 + %onebit) U: full-set S: full-set ; CHECK-NEXT: %masked = and i32 %mask, %val -; CHECK-NEXT: --> %masked U: full-set S: full-set +; CHECK-NEXT: --> %masked U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mask_a ; %onebit = shl i32 1, %numlowbits @@ -45,11 +45,11 @@ ; CHECK-LABEL: 'mask_b' ; CHECK-NEXT: Classifying expressions for: @mask_b ; CHECK-NEXT: %notmask = shl i32 -1, %numlowbits -; CHECK-NEXT: --> %notmask U: full-set S: full-set +; CHECK-NEXT: --> %notmask U: full-set S: full-set ; CHECK-NEXT: %mask = xor i32 %notmask, -1 -; CHECK-NEXT: --> (-1 + (-1 * %notmask)) U: full-set S: full-set +; CHECK-NEXT: --> (-1 + (-1 * %notmask)) U: full-set S: full-set ; CHECK-NEXT: %masked = and i32 %mask, %val -; CHECK-NEXT: --> %masked U: full-set S: full-set +; CHECK-NEXT: --> %masked U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mask_b ; %notmask = shl i32 -1, %numlowbits @@ -62,11 +62,11 @@ ; CHECK-LABEL: 'mask_c' ; CHECK-NEXT: Classifying expressions for: @mask_c ; CHECK-NEXT: %numhighbits = sub i32 32, %numlowbits -; CHECK-NEXT: --> (32 + (-1 * %numlowbits)) U: full-set S: full-set +; CHECK-NEXT: --> (32 + (-1 * %numlowbits)) U: full-set S: full-set ; CHECK-NEXT: %mask = lshr i32 -1, %numhighbits -; CHECK-NEXT: --> %mask U: full-set S: full-set +; CHECK-NEXT: --> %mask U: full-set S: full-set ; CHECK-NEXT: %masked = and i32 %mask, %val -; CHECK-NEXT: --> %masked U: full-set S: full-set +; CHECK-NEXT: --> %masked U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mask_c ; %numhighbits = sub i32 32, %numlowbits @@ -79,11 +79,11 @@ ; CHECK-LABEL: 'mask_d' ; CHECK-NEXT: Classifying expressions for: @mask_d ; CHECK-NEXT: %numhighbits = sub i32 32, %numlowbits -; CHECK-NEXT: --> (32 + (-1 * %numlowbits)) U: full-set S: full-set +; CHECK-NEXT: --> (32 + (-1 * %numlowbits)) U: full-set S: full-set ; CHECK-NEXT: %highbitscleared = shl i32 %val, %numhighbits -; CHECK-NEXT: --> %highbitscleared U: full-set S: full-set +; CHECK-NEXT: --> %highbitscleared U: full-set S: full-set ; CHECK-NEXT: %masked = lshr i32 %highbitscleared, %numhighbits -; CHECK-NEXT: --> %masked U: full-set S: full-set +; CHECK-NEXT: --> %masked U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @mask_d ; %numhighbits = sub i32 32, %numlowbits diff --git a/llvm/test/Analysis/ScalarEvolution/flags-from-poison-noautogen.ll b/llvm/test/Analysis/ScalarEvolution/flags-from-poison-noautogen.ll --- a/llvm/test/Analysis/ScalarEvolution/flags-from-poison-noautogen.ll +++ b/llvm/test/Analysis/ScalarEvolution/flags-from-poison-noautogen.ll @@ -11,11 +11,11 @@ ; CHECK-LABEL: 'subrecurrences' ; CHECK-NEXT: Classifying expressions for: @subrecurrences ; CHECK-NEXT: %o_idx = phi i32 [ 0, %entry ], [ %o_idx.inc, %outer.be ] -; CHECK-NEXT: --> {0,+,1}<%outer> U: [0,-2147483648) S: [0,-2147483648) Exits: %outer_l LoopDispositions: { %outer: Computable, %inner: Invariant } +; CHECK-NEXT: --> {0,+,1}<%outer> U: [0,2147483648) S: [0,-2147483648) Exits: %outer_l LoopDispositions: { %outer: Computable, %inner: Invariant } ; CHECK-NEXT: %o_idx.inc = add nsw i32 %o_idx, 1 ; CHECK-NEXT: --> {1,+,1}<%outer> U: [1,0) S: [1,0) Exits: (1 + %outer_l) LoopDispositions: { %outer: Computable, %inner: Invariant } ; CHECK-NEXT: %i_idx = phi i32 [ 0, %outer ], [ %i_idx.inc, %inner ] -; CHECK-NEXT: --> {0,+,1}<%inner> U: [0,-2147483648) S: [0,-2147483648) Exits: %inner_l LoopDispositions: { %inner: Computable, %outer: Variant } +; CHECK-NEXT: --> {0,+,1}<%inner> U: [0,2147483648) S: [0,-2147483648) Exits: %inner_l LoopDispositions: { %inner: Computable, %outer: Variant } ; CHECK-NEXT: %i_idx.inc = add nsw i32 %i_idx, 1 ; CHECK-NEXT: --> {1,+,1}<%inner> U: [1,0) S: [1,0) Exits: (1 + %inner_l) LoopDispositions: { %inner: Computable, %outer: Variant } ; CHECK-NEXT: %v = sub nsw i32 %i_idx, %o_idx.inc diff --git a/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll b/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll --- a/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll +++ b/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll @@ -19,11 +19,11 @@ ; CHECK-LABEL: 'test-add-nsw' ; CHECK-NEXT: Classifying expressions for: @test-add-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {(sext i32 %offset to i64),+,1}<%loop> U: [-2147483648,6442450943) S: [-2147483648,6442450943) Exits: ((zext i32 (-1 + %numIterations) to i64) + (sext i32 %offset to i64)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(sext i32 %offset to i64),+,1}<%loop> U: [18446744071562067968,6442450943) S: [-2147483648,6442450943) Exits: ((zext i32 (-1 + %numIterations) to i64) + (sext i32 %offset to i64)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -385,7 +385,7 @@ ; CHECK-NEXT: %index32 = add nuw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %cmp.idx = sext i1 %cmp to i32 -; CHECK-NEXT: --> (sext i1 %cmp to i32) U: [-1,1) S: [-1,1) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (sext i1 %cmp to i32) U: [4294967295,1) S: [-1,1) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %cmp.idx ; CHECK-NEXT: --> ((4 * (sext i1 %cmp to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 @@ -461,13 +461,13 @@ ; CHECK-LABEL: 'test-add-not-header' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-1 + %offset + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-not-header ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -500,13 +500,13 @@ ; CHECK-LABEL: 'test-add-not-header2' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-not-header2 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -539,7 +539,7 @@ ; CHECK-LABEL: 'test-add-not-header3' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header3 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 @@ -584,13 +584,13 @@ ; CHECK-LABEL: 'test-add-not-header4' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header4 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-not-header4 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -626,7 +626,7 @@ ; CHECK-LABEL: 'test-add-not-header5' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header5 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 @@ -661,7 +661,7 @@ ; CHECK-LABEL: 'test-add-call' ; CHECK-NEXT: Classifying expressions for: @test-add-call ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 @@ -699,7 +699,7 @@ ; CHECK-LABEL: 'test-add-call2' ; CHECK-NEXT: Classifying expressions for: @test-add-call2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 @@ -736,13 +736,13 @@ ; CHECK-LABEL: 'test-gep-propagates-poison' ; CHECK-NEXT: Classifying expressions for: @test-gep-propagates-poison ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-gep-propagates-poison ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -773,15 +773,15 @@ ; CHECK-LABEL: 'test-add-mul-propagates' ; CHECK-NEXT: Classifying expressions for: @test-add-mul-propagates ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indexmul = mul nuw i32 %index32, 2 -; CHECK-NEXT: --> {(2 * %offset),+,2}<%loop> U: [0,-1) S: [-2147483648,2147483647) Exits: (-2 + (2 * %offset) + (2 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(2 * %offset),+,2}<%loop> U: [0,4294967295) S: [-2147483648,2147483647) Exits: (-2 + (2 * %offset) + (2 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul ; CHECK-NEXT: --> ((4 * (sext i32 {(2 * %offset),+,2}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2 + (2 * %offset) + (2 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-mul-propagates ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -812,7 +812,7 @@ ; CHECK-LABEL: 'test-mul-propagates-poison' ; CHECK-NEXT: Classifying expressions for: @test-mul-propagates-poison ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indexmul = mul nsw i32 %index32, %offset @@ -820,7 +820,7 @@ ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul ; CHECK-NEXT: --> {((4 * (sext i32 (%offset * %offset) to i64)) + %input),+,(4 * (sext i32 %offset to i64))}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (%offset * %offset) to i64)) + (4 * (zext i32 (-1 + %numIterations) to i64) * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-mul-propagates-poison ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -850,15 +850,15 @@ ; CHECK-LABEL: 'test-mul-propagates-poison-2' ; CHECK-NEXT: Classifying expressions for: @test-mul-propagates-poison-2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indexmul = mul i32 %index32, 2 -; CHECK-NEXT: --> {(2 * %offset),+,2}<%loop> U: [0,-1) S: [-2147483648,2147483647) Exits: (-2 + (2 * %offset) + (2 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(2 * %offset),+,2}<%loop> U: [0,4294967295) S: [-2147483648,2147483647) Exits: (-2 + (2 * %offset) + (2 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul ; CHECK-NEXT: --> ((4 * (sext i32 {(2 * %offset),+,2}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2 + (2 * %offset) + (2 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-mul-propagates-poison-2 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -889,13 +889,13 @@ ; CHECK-LABEL: 'test-add-div' ; CHECK-NEXT: Classifying expressions for: @test-add-div ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %j = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %q = sdiv i32 %numIterations, %j ; CHECK-NEXT: --> %q U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-div ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -924,13 +924,13 @@ ; CHECK-LABEL: 'test-add-div2' ; CHECK-NEXT: Classifying expressions for: @test-add-div2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %j = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %q = sdiv i32 %j, %numIterations ; CHECK-NEXT: --> %q U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-div2 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -959,13 +959,13 @@ ; CHECK-LABEL: 'test-add-store' ; CHECK-NEXT: Classifying expressions for: @test-add-store ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-store ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -1000,15 +1000,15 @@ ; CHECK-NEXT: %seq = add nuw nsw i32 %index32, 1 ; CHECK-NEXT: --> {(2 + %offset),+,1}<%loop> U: full-set S: full-set Exits: (1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %j = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %j, %offset -; CHECK-NEXT: --> {(1 + %offset),+,1}<%loop> U: [-2147483647,-2147483648) S: [-2147483647,-2147483648) Exits: (%offset + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(1 + %offset),+,1}<%loop> U: [2147483649,2147483648) S: [-2147483647,-2147483648) Exits: (%offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(4 + (4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: (4 + (4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-twice ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -1044,15 +1044,15 @@ ; CHECK-LABEL: 'test-mul-nsw' ; CHECK-NEXT: Classifying expressions for: @test-mul-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = mul nsw i32 %i, %stride ; CHECK-NEXT: --> {0,+,%stride}<%loop> U: full-set S: full-set Exits: ((-1 + %numIterations) * %stride) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {0,+,(sext i32 %stride to i64)}<%loop> U: [-9223372034707292160,9223372030412324866) S: [-9223372034707292160,9223372030412324866) Exits: ((zext i32 (-1 + %numIterations) to i64) * (sext i32 %stride to i64)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,(sext i32 %stride to i64)}<%loop> U: [9223372039002259456,9223372030412324866) S: [-9223372034707292160,9223372030412324866) Exits: ((zext i32 (-1 + %numIterations) to i64) * (sext i32 %stride to i64)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {%input,+,(4 * (sext i32 %stride to i64))}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64) * (sext i32 %stride to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-mul-nsw ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -1124,9 +1124,9 @@ ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] ; CHECK-NEXT: --> {%start,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nsw i32 %i, 8 -; CHECK-NEXT: --> {(256 * %start),+,256}<%loop> U: [0,-255) S: [-2147483648,2147483393) Exits: (-256 + (256 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(256 * %start),+,256}<%loop> U: [0,4294967041) S: [-2147483648,2147483393) Exits: (-256 + (256 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {(sext i32 (256 * %start) to i64),+,256}<%loop> U: [0,-255) S: [-2147483648,1101659110913) Exits: ((sext i32 (256 * %start) to i64) + (256 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(sext i32 (256 * %start) to i64),+,256}<%loop> U: [0,18446744073709551361) S: [-2147483648,1101659110913) Exits: ((sext i32 (256 * %start) to i64) + (256 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 (256 * %start) to i64)) + %input),+,1024}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (256 * %start) to i64)) + (1024 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1164,9 +1164,9 @@ ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] ; CHECK-NEXT: --> {%start,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nuw i32 %i, 31 -; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,-2147483647) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,2147483649) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64) U: [0,-2147483647) S: [-2147483648,1) Exits: (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64) U: [0,18446744071562067969) S: [-2147483648,1) Exits: (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> ((4 * (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1204,9 +1204,9 @@ ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] ; CHECK-NEXT: --> {%start,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nuw nsw i32 %i, 31 -; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,-2147483647) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,2147483649) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {(sext i32 (-2147483648 * %start) to i64),+,-2147483648}<%loop> U: [0,-2147483647) S: [-9223372036854775808,1) Exits: ((sext i32 (-2147483648 * %start) to i64) + (-2147483648 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(sext i32 (-2147483648 * %start) to i64),+,-2147483648}<%loop> U: [0,18446744071562067969) S: [-9223372036854775808,1) Exits: ((sext i32 (-2147483648 * %start) to i64) + (-2147483648 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 (-2147483648 * %start) to i64)) + %input),+,-8589934592}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (-2147483648 * %start) to i64)) + (-8589934592 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1244,9 +1244,9 @@ ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] ; CHECK-NEXT: --> {%start,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nsw i32 %i, 31 -; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,-2147483647) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,2147483649) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64) U: [0,-2147483647) S: [-2147483648,1) Exits: (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64) U: [0,18446744071562067969) S: [-2147483648,1) Exits: (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> ((4 * (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1284,9 +1284,9 @@ ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] ; CHECK-NEXT: --> {%start,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nsw i32 %i, 30 -; CHECK-NEXT: --> {(1073741824 * %start),+,1073741824}<%loop> U: [0,-1073741823) S: [-2147483648,1073741825) Exits: (-1073741824 + (1073741824 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(1073741824 * %start),+,1073741824}<%loop> U: [0,3221225473) S: [-2147483648,1073741825) Exits: (-1073741824 + (1073741824 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {(sext i32 (1073741824 * %start) to i64),+,1073741824}<%loop> U: [0,-1073741823) S: [-2147483648,4611686018427387905) Exits: ((sext i32 (1073741824 * %start) to i64) + (1073741824 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(sext i32 (1073741824 * %start) to i64),+,1073741824}<%loop> U: [0,18446744072635809793) S: [-2147483648,4611686018427387905) Exits: ((sext i32 (1073741824 * %start) to i64) + (1073741824 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 (1073741824 * %start) to i64)) + %input),+,4294967296}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (1073741824 * %start) to i64)) + (4294967296 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1324,7 +1324,7 @@ ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nuw i32 %i, 9 -; CHECK-NEXT: --> {0,+,512}<%loop> U: [0,-511) S: [-2147483648,2147483137) Exits: (-512 + (512 * %numIterations)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,512}<%loop> U: [0,4294966785) S: [-2147483648,2147483137) Exits: (-512 + (512 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {0,+,512}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-512 + (512 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 @@ -1365,7 +1365,7 @@ ; CHECK-NEXT: %index32 = sub nsw i32 %i, %sub ; CHECK-NEXT: --> {((-1 * %sub) + %start),+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %sub) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {((sext i32 %start to i64) + (-1 * (sext i32 %sub to i64))),+,1}<%loop> U: [-4294967295,8589934591) S: [-4294967295,8589934591) Exits: ((zext i32 (-1 + (-1 * %start) + %numIterations) to i64) + (sext i32 %start to i64) + (-1 * (sext i32 %sub to i64))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {((sext i32 %start to i64) + (-1 * (sext i32 %sub to i64))),+,1}<%loop> U: [18446744069414584321,8589934591) S: [-4294967295,8589934591) Exits: ((zext i32 (-1 + (-1 * %start) + %numIterations) to i64) + (sext i32 %start to i64) + (-1 * (sext i32 %sub to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 %start to i64)) + (-4 * (sext i32 %sub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + (4 * (sext i32 %start to i64)) + (-4 * (sext i32 %sub to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1401,13 +1401,13 @@ ; CHECK-LABEL: 'test-sub-nsw' ; CHECK-NEXT: Classifying expressions for: @test-sub-nsw ; CHECK-NEXT: %halfsub = ashr i32 %sub, 1 -; CHECK-NEXT: --> %halfsub U: [-1073741824,1073741824) S: [-1073741824,1073741824) +; CHECK-NEXT: --> %halfsub U: [3221225472,1073741824) S: [-1073741824,1073741824) ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] ; CHECK-NEXT: --> {%start,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = sub nsw i32 %i, %halfsub ; CHECK-NEXT: --> {((-1 * %halfsub) + %start),+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %halfsub) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {((sext i32 %start to i64) + (-1 * (sext i32 %halfsub to i64))),+,1}<%loop> U: [-3221225471,7516192767) S: [-3221225471,7516192767) Exits: ((zext i32 (-1 + (-1 * %start) + %numIterations) to i64) + (sext i32 %start to i64) + (-1 * (sext i32 %halfsub to i64))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {((sext i32 %start to i64) + (-1 * (sext i32 %halfsub to i64))),+,1}<%loop> U: [18446744070488326145,7516192767) S: [-3221225471,7516192767) Exits: ((zext i32 (-1 + (-1 * %start) + %numIterations) to i64) + (sext i32 %start to i64) + (-1 * (sext i32 %halfsub to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 %start to i64)) + (-4 * (sext i32 %halfsub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + (4 * (sext i32 %start to i64)) + (-4 * (sext i32 %halfsub to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1444,15 +1444,15 @@ ; CHECK-LABEL: 'test-sub-nsw-lhs-non-negative' ; CHECK-NEXT: Classifying expressions for: @test-sub-nsw-lhs-non-negative ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = sub nsw i32 %i, %sub ; CHECK-NEXT: --> {(-1 * %sub),+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %sub) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 -; CHECK-NEXT: --> {(-1 * (sext i32 %sub to i64)),+,1}<%loop> U: [-2147483647,6442450944) S: [-2147483647,6442450944) Exits: ((zext i32 (-1 + %numIterations) to i64) + (-1 * (sext i32 %sub to i64))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-1 * (sext i32 %sub to i64)),+,1}<%loop> U: [18446744071562067969,6442450944) S: [-2147483647,6442450944) Exits: ((zext i32 (-1 + %numIterations) to i64) + (-1 * (sext i32 %sub to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((-4 * (sext i32 %sub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (-4 * (sext i32 %sub to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-sub-nsw-lhs-non-negative ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -1485,13 +1485,13 @@ ; CHECK-LABEL: 'test-sext-sub' ; CHECK-NEXT: Classifying expressions for: @test-sext-sub ; CHECK-NEXT: %i = phi i32 [ %nexti, %cont ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %val = extractvalue { i32, i1 } %ssub, 0 ; CHECK-NEXT: --> {(-1 * %sub),+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ovfl = extractvalue { i32, i1 } %ssub, 1 ; CHECK-NEXT: --> %ovfl U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %index64 = sext i32 %val to i64 -; CHECK-NEXT: --> {(-1 * (sext i32 %sub to i64)),+,1}<%loop> U: [-2147483647,6442450944) S: [-2147483647,6442450944) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-1 * (sext i32 %sub to i64)),+,1}<%loop> U: [18446744071562067969,6442450944) S: [-2147483647,6442450944) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((-4 * (sext i32 %sub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 @@ -1542,15 +1542,15 @@ ; CHECK-NEXT: %seq = add nuw nsw i32 %index32, 1 ; CHECK-NEXT: --> {(2 + (-1 * %offset)),+,1}<%loop> U: full-set S: full-set Exits: (1 + (-1 * %offset) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %j = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = sub nsw i32 %j, %offset -; CHECK-NEXT: --> {(1 + (-1 * %offset)),+,1}<%loop> U: [-2147483647,-2147483648) S: [-2147483647,-2147483648) Exits: ((-1 * %offset) + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(1 + (-1 * %offset)),+,1}<%loop> U: [2147483649,2147483648) S: [-2147483647,-2147483648) Exits: ((-1 * %offset) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(4 + (4 * (sext i32 (-1 * %offset) to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: (4 + (4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 (-1 * %offset) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-sub-with-add ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -1602,7 +1602,7 @@ ; CHECK-NEXT: %i4 = extractvalue { i32, i1 } %i2, 1 ; CHECK-NEXT: --> %i4 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %idxprom = sext i32 %i3 to i64 -; CHECK-NEXT: --> (sext i32 {(-1 + %pre7),+,-1}<%for.cond> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %for.cond: Computable } +; CHECK-NEXT: --> (sext i32 {(-1 + %pre7),+,-1}<%for.cond> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %i6 = load ptr, ptr %i1, align 8 ; CHECK-NEXT: --> %i6 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %i7 = getelementptr inbounds i8, ptr %i6, i64 %idxprom @@ -1610,7 +1610,7 @@ ; CHECK-NEXT: %i8 = load i8, ptr %i7, align 1 ; CHECK-NEXT: --> %i8 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %conv5 = sext i8 %i8 to i64 -; CHECK-NEXT: --> (sext i8 %i8 to i64) U: [-128,128) S: [-128,128) Exits: <> LoopDispositions: { %for.cond: Variant } +; CHECK-NEXT: --> (sext i8 %i8 to i64) U: [18446744073709551488,128) S: [-128,128) Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %i9 = inttoptr i64 %conv5 to ptr ; CHECK-NEXT: --> %i9 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %ph = phi ptr [ %i9, %cont1 ], [ %i1, %if.then ] @@ -1738,7 +1738,7 @@ ; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = sext i32 %a to i64 -; CHECK-NEXT: --> (sext i32 %a to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %a to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %res = add nuw i64 %x, %arg ; CHECK-NEXT: --> ((sext i32 %a to i64) + %arg) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @add-sext-recurse diff --git a/llvm/test/Analysis/ScalarEvolution/fold.ll b/llvm/test/Analysis/ScalarEvolution/fold.ll --- a/llvm/test/Analysis/ScalarEvolution/fold.ll +++ b/llvm/test/Analysis/ScalarEvolution/fold.ll @@ -121,7 +121,7 @@ ; CHECK-NEXT: %E = and i32 %i, 64 ; CHECK-NEXT: --> (64 * (zext i1 (trunc i32 (%i /u 64) to i1) to i32)) U: [0,65) S: [0,65) ; CHECK-NEXT: %F = and i32 %i, -2147483648 -; CHECK-NEXT: --> (-2147483648 * (%i /u -2147483648)) U: [0,-2147483647) S: [-2147483648,1) +; CHECK-NEXT: --> (-2147483648 * (%i /u -2147483648)) U: [0,2147483649) S: [-2147483648,1) ; CHECK-NEXT: Determining loop execution counts for: @test5 ; %A = and i32 %i, 1 @@ -139,9 +139,9 @@ ; CHECK-NEXT: %A = zext i8 %x to i16 ; CHECK-NEXT: --> (zext i8 %x to i16) U: [0,256) S: [0,256) ; CHECK-NEXT: %B = shl nuw i16 %A, 8 -; CHECK-NEXT: --> (256 * (zext i8 %x to i16)) U: [0,-255) S: [-32768,32513) +; CHECK-NEXT: --> (256 * (zext i8 %x to i16)) U: [0,65281) S: [-32768,32513) ; CHECK-NEXT: %C = and i16 %B, -2048 -; CHECK-NEXT: --> (2048 * ((zext i8 %x to i16) /u 8)) U: [0,-2047) S: [-32768,30721) +; CHECK-NEXT: --> (2048 * ((zext i8 %x to i16) /u 8)) U: [0,63489) S: [-32768,30721) ; CHECK-NEXT: Determining loop execution counts for: @test6 ; %A = zext i8 %x to i16 @@ -155,11 +155,11 @@ ; CHECK-LABEL: 'test7' ; CHECK-NEXT: Classifying expressions for: @test7 ; CHECK-NEXT: %B = sext i32 %A to i64 -; CHECK-NEXT: --> (sext i32 %A to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %A to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %C = zext i32 %A to i64 ; CHECK-NEXT: --> (zext i32 %A to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %D = sub i64 %B, %C -; CHECK-NEXT: --> ((sext i32 %A to i64) + (-1 * (zext i32 %A to i64))) U: [-6442450943,2147483648) S: [-6442450943,2147483648) +; CHECK-NEXT: --> ((sext i32 %A to i64) + (-1 * (zext i32 %A to i64))) U: [18446744067267100673,2147483648) S: [-6442450943,2147483648) ; CHECK-NEXT: %E = trunc i64 %D to i16 ; CHECK-NEXT: --> 0 U: [0,1) S: [0,1) ; CHECK-NEXT: Determining loop execution counts for: @test7 diff --git a/llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll b/llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll --- a/llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll +++ b/llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll @@ -21,7 +21,7 @@ ; CHECK-NEXT: %idxprom20 = zext i32 %storemerge1921 to i64 ; CHECK-NEXT: --> {3,+,4294967295}<%for.cond6> U: [3,4) S: [3,4) Exits: <> LoopDispositions: { %for.cond6: Computable, %outer.loop: Variant } ; CHECK-NEXT: %arrayidx7 = getelementptr inbounds [1 x [4 x i16]], ptr @__const.f.g, i64 0, i64 0, i64 %idxprom20 -; CHECK-NEXT: --> {(6 + @__const.f.g),+,8589934590}<%for.cond6> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %for.cond6: Computable, %outer.loop: Variant } +; CHECK-NEXT: --> {(6 + @__const.f.g),+,8589934590}<%for.cond6> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %for.cond6: Computable, %outer.loop: Variant } ; CHECK-NEXT: %i = load i16, ptr %arrayidx7, align 2 ; CHECK-NEXT: --> %i U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond6: Variant, %outer.loop: Variant } ; CHECK-NEXT: %storemerge1822.lcssa.ph = phi i32 [ 0, %for.cond6 ] @@ -45,7 +45,7 @@ ; CHECK-NEXT: %idxprom20.3 = zext i32 %storemerge1921.3 to i64 ; CHECK-NEXT: --> {3,+,4294967295}<%inner.loop> U: [3,4) S: [3,4) Exits: <> LoopDispositions: { %inner.loop: Computable, %outer.loop: Variant } ; CHECK-NEXT: %arrayidx7.3 = getelementptr inbounds [1 x [4 x i16]], ptr @__const.f.g, i64 0, i64 0, i64 %idxprom20.3 -; CHECK-NEXT: --> {(6 + @__const.f.g),+,8589934590}<%inner.loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %inner.loop: Computable, %outer.loop: Variant } +; CHECK-NEXT: --> {(6 + @__const.f.g),+,8589934590}<%inner.loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %inner.loop: Computable, %outer.loop: Variant } ; CHECK-NEXT: %i7 = load i16, ptr %arrayidx7.3, align 2 ; CHECK-NEXT: --> %i7 U: full-set S: full-set Exits: <> LoopDispositions: { %inner.loop: Variant, %outer.loop: Variant } ; CHECK-NEXT: %i8 = load volatile i32, ptr @b, align 4 diff --git a/llvm/test/Analysis/ScalarEvolution/increasing-or-decreasing-iv.ll b/llvm/test/Analysis/ScalarEvolution/increasing-or-decreasing-iv.ll --- a/llvm/test/Analysis/ScalarEvolution/increasing-or-decreasing-iv.ll +++ b/llvm/test/Analysis/ScalarEvolution/increasing-or-decreasing-iv.ll @@ -13,7 +13,7 @@ ; CHECK-NEXT: %iv = phi i32 [ %start, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {%start,+,%step}<%loop> U: [0,128) S: [0,128) Exits: ((127 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [4294967040,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %loop.iv.inc = add i32 %loop.iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,129) S: [1,129) Exits: 128 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f0 @@ -47,7 +47,7 @@ ; CHECK-NEXT: %start = select i1 %c, i32 120, i32 0 ; CHECK-NEXT: --> %start U: [0,121) S: [0,121) ; CHECK-NEXT: %step = select i1 %c, i32 -8, i32 8 -; CHECK-NEXT: --> %step U: [8,-7) S: [-16,16) +; CHECK-NEXT: --> %step U: [8,4294967289) S: [-16,16) ; CHECK-NEXT: %loop.iv = phi i32 [ 0, %entry ], [ %loop.iv.inc, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,16) S: [0,16) Exits: 15 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv = phi i32 [ %start, %entry ], [ %iv.next, %loop ] @@ -67,21 +67,21 @@ ; CHECK-NEXT: %iv.7 = add i32 %iv, 7 ; CHECK-NEXT: --> {(7 + %start),+,%step}<%loop> U: [7,128) S: [7,128) Exits: (7 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m1 = sub i32 %iv, 1 -; CHECK-NEXT: --> {(-1 + %start),+,%step}<%loop> U: [-1,120) S: [-1,120) Exits: (-1 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-1 + %start),+,%step}<%loop> U: [4294967295,120) S: [-1,120) Exits: (-1 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m2 = sub i32 %iv, 2 -; CHECK-NEXT: --> {(-2 + %start),+,%step}<%loop> U: [0,-1) S: [-2,119) Exits: (-2 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-2 + %start),+,%step}<%loop> U: [0,4294967295) S: [-2,119) Exits: (-2 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m3 = sub i32 %iv, 3 -; CHECK-NEXT: --> {(-3 + %start),+,%step}<%loop> U: [-3,118) S: [-3,118) Exits: (-3 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-3 + %start),+,%step}<%loop> U: [4294967293,118) S: [-3,118) Exits: (-3 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m4 = sub i32 %iv, 4 -; CHECK-NEXT: --> {(-4 + %start),+,%step}<%loop> U: [0,-3) S: [-4,117) Exits: (-4 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-4 + %start),+,%step}<%loop> U: [0,4294967293) S: [-4,117) Exits: (-4 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m5 = sub i32 %iv, 5 -; CHECK-NEXT: --> {(-5 + %start),+,%step}<%loop> U: [-5,116) S: [-5,116) Exits: (-5 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-5 + %start),+,%step}<%loop> U: [4294967291,116) S: [-5,116) Exits: (-5 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m6 = sub i32 %iv, 6 -; CHECK-NEXT: --> {(-6 + %start),+,%step}<%loop> U: [0,-1) S: [-6,115) Exits: (-6 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-6 + %start),+,%step}<%loop> U: [0,4294967295) S: [-6,115) Exits: (-6 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.m7 = sub i32 %iv, 7 -; CHECK-NEXT: --> {(-7 + %start),+,%step}<%loop> U: [-7,114) S: [-7,114) Exits: (-7 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-7 + %start),+,%step}<%loop> U: [4294967289,114) S: [-7,114) Exits: (-7 + (15 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [0,-7) S: [-256,361) Exits: ((16 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [0,4294967289) S: [-256,361) Exits: ((16 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %loop.iv.inc = add i32 %loop.iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,17) S: [1,17) Exits: 16 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f1 @@ -142,7 +142,7 @@ ; CHECK-NEXT: %iv.sext = sext i32 %iv to i64 ; CHECK-NEXT: --> {(zext i32 %start to i64),+,(sext i32 %step to i64)}<%loop> U: [0,128) S: [0,128) Exits: ((zext i32 %start to i64) + (127 * (sext i32 %step to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [4294967040,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %loop.iv.inc = add i32 %loop.iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,129) S: [1,129) Exits: 128 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f2 @@ -181,7 +181,7 @@ ; CHECK-NEXT: %loop.iv = phi i16 [ 0, %entry ], [ %loop.iv.inc, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,128) S: [0,128) Exits: 127 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv = phi i16 [ %start, %entry ], [ %iv.next, %loop ] -; CHECK-NEXT: --> {%start,+,%step}<%loop> U: [0,-892) S: [0,-892) Exits: ((127 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {%start,+,%step}<%loop> U: [0,64644) S: [0,-892) Exits: ((127 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.zext = zext i16 %iv to i64 ; CHECK-NEXT: --> {(zext i16 %start to i64),+,(zext i16 %step to i64)}<%loop> U: [0,64644) S: [0,64644) Exits: ((zext i16 %start to i64) + (127 * (zext i16 %step to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i16 %iv, %step @@ -235,7 +235,7 @@ ; CHECK-NEXT: %iv.trunc = trunc i32 %iv to i16 ; CHECK-NEXT: --> {(trunc i32 %start to i16),+,(trunc i32 %step to i16)}<%loop> U: full-set S: full-set Exits: ((trunc i32 %start to i16) + (127 * (trunc i32 %step to i16))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [4294967040,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %loop.iv.inc = add i32 %loop.iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,129) S: [1,129) Exits: 128 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f4 @@ -284,7 +284,7 @@ ; CHECK-NEXT: %iv.trunc = trunc i32 %iv to i16 ; CHECK-NEXT: --> {(trunc i32 %start to i16),+,(trunc i32 %step to i16)}<%loop> U: [0,128) S: [0,128) Exits: ((trunc i32 %start to i16) + (127 * (trunc i32 %step to i16))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [4294967040,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %loop.iv.inc = add i16 %loop.iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,129) S: [1,129) Exits: 128 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f5 @@ -320,7 +320,7 @@ ; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0 ; CHECK-NEXT: --> %start U: [0,128) S: [0,128) ; CHECK-NEXT: %step = select i1 %c, i32 -2, i32 0 -; CHECK-NEXT: --> %step U: [0,-1) S: [-2,2) +; CHECK-NEXT: --> %step U: [0,4294967295) S: [-2,2) ; CHECK-NEXT: %loop.iv = phi i16 [ 0, %entry ], [ %loop.iv.inc, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,128) S: [0,128) Exits: 127 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv = phi i32 [ %start, %entry ], [ %iv.next, %loop ] @@ -328,7 +328,7 @@ ; CHECK-NEXT: %step.plus.one = add i32 %step, 1 ; CHECK-NEXT: --> (1 + %step) U: [1,0) S: [-1,3) Exits: (1 + %step) LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: %iv.next = add i32 %iv, %step.plus.one -; CHECK-NEXT: --> {(1 + %step + %start),+,(1 + %step)}<%loop> U: [-128,384) S: [-128,384) Exits: (128 + (128 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(1 + %step + %start),+,(1 + %step)}<%loop> U: [4294967168,384) S: [-128,384) Exits: (128 + (128 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.sext = sext i32 %iv to i64 ; CHECK-NEXT: --> {(zext i32 %start to i64),+,(1 + (sext i32 %step to i64))}<%loop> U: [0,128) S: [0,128) Exits: (127 + (zext i32 %start to i64) + (127 * (sext i32 %step to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %loop.iv.inc = add i16 %loop.iv, 1 @@ -375,7 +375,7 @@ ; CHECK-NEXT: %iv.trunc = trunc i32 %iv to i16 ; CHECK-NEXT: --> {(trunc i32 %start to i16),+,(trunc i32 %step to i16)}<%loop> U: [0,128) S: [0,128) Exits: ((trunc i32 %start to i16) + (127 * (trunc i32 %step to i16))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [4294967040,256) S: [-256,256) Exits: ((128 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.trunc.plus.one = add i16 %iv.trunc, 1 ; CHECK-NEXT: --> {(1 + (trunc i32 %start to i16)),+,(trunc i32 %step to i16)}<%loop> U: [1,129) S: [1,129) Exits: (1 + (trunc i32 %start to i16) + (127 * (trunc i32 %step to i16))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.trunc.plus.two = add i16 %iv.trunc, 2 diff --git a/llvm/test/Analysis/ScalarEvolution/load.ll b/llvm/test/Analysis/ScalarEvolution/load.ll --- a/llvm/test/Analysis/ScalarEvolution/load.ll +++ b/llvm/test/Analysis/ScalarEvolution/load.ll @@ -16,11 +16,11 @@ ; CHECK-NEXT: %i.03 = phi i32 [ 0, %entry ], [ %inc, %for.body ] ; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,50) S: [0,50) Exits: 49 LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %arrayidx = getelementptr inbounds [50 x i32], ptr @arr1, i32 0, i32 %i.03 -; CHECK-NEXT: --> {@arr1,+,4}<%for.body> U: [0,-3) S: [-2147483648,2147483645) Exits: (196 + @arr1) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {@arr1,+,4}<%for.body> U: [0,4294967293) S: [-2147483648,2147483645) Exits: (196 + @arr1) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %0 = load i32, ptr %arrayidx, align 4 ; CHECK-NEXT: --> %0 U: full-set S: full-set Exits: 50 LoopDispositions: { %for.body: Variant } ; CHECK-NEXT: %arrayidx1 = getelementptr inbounds [50 x i32], ptr @arr2, i32 0, i32 %i.03 -; CHECK-NEXT: --> {@arr2,+,4}<%for.body> U: [0,-3) S: [-2147483648,2147483645) Exits: (196 + @arr2) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {@arr2,+,4}<%for.body> U: [0,4294967293) S: [-2147483648,2147483645) Exits: (196 + @arr2) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %1 = load i32, ptr %arrayidx1, align 4 ; CHECK-NEXT: --> %1 U: full-set S: full-set Exits: 0 LoopDispositions: { %for.body: Variant } ; CHECK-NEXT: %add = add i32 %0, %sum.04 diff --git a/llvm/test/Analysis/ScalarEvolution/logical-operations.ll b/llvm/test/Analysis/ScalarEvolution/logical-operations.ll --- a/llvm/test/Analysis/ScalarEvolution/logical-operations.ll +++ b/llvm/test/Analysis/ScalarEvolution/logical-operations.ll @@ -400,7 +400,7 @@ ; CHECK-LABEL: 'select_between_constantptrs' ; CHECK-NEXT: Classifying expressions for: @select_between_constantptrs ; CHECK-NEXT: %r = select i1 %c, ptr @constant, ptr @another_constant -; CHECK-NEXT: --> %r U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> %r U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: Determining loop execution counts for: @select_between_constantptrs ; %r = select i1 %c, ptr @constant, ptr @another_constant @@ -411,7 +411,7 @@ ; CHECK-LABEL: 'tautological_select' ; CHECK-NEXT: Classifying expressions for: @tautological_select ; CHECK-NEXT: %r = getelementptr i8, ptr @constant, i32 0 -; CHECK-NEXT: --> @constant U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> @constant U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: Determining loop execution counts for: @tautological_select ; %r = getelementptr i8, ptr select (i1 true, ptr @constant, ptr @another_constant), i32 0 @@ -424,7 +424,7 @@ ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %latch ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,101) S: [0,101) Exits: 100 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %r = phi ptr [ @constant, %truebb ], [ @another_constant, %falsebb ] -; CHECK-NEXT: --> %r U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %r U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.next = add i32 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,102) S: [1,102) Exits: 101 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @tautological_select_like_phi @@ -723,7 +723,7 @@ ; CHECK-LABEL: 'umin_seq_x_y_sext_both' ; CHECK-NEXT: Classifying expressions for: @umin_seq_x_y_sext_both ; CHECK-NEXT: %x = sext i8 %x.narrow to i32 -; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %y, i32 %x) ; CHECK-NEXT: --> ((sext i8 %x.narrow to i32) umin %y) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %x.is.zero, i32 0, i32 %umin @@ -741,7 +741,7 @@ ; CHECK-LABEL: 'umin_seq_x_y_sext_in_umin' ; CHECK-NEXT: Classifying expressions for: @umin_seq_x_y_sext_in_umin ; CHECK-NEXT: %x = sext i8 %x.narrow to i32 -; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %y, i32 %x) ; CHECK-NEXT: --> ((sext i8 %x.narrow to i32) umin %y) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %x.is.zero, i32 0, i32 %umin @@ -759,7 +759,7 @@ ; CHECK-LABEL: 'umin_seq_x_y_sext_in_iszero' ; CHECK-NEXT: Classifying expressions for: @umin_seq_x_y_sext_in_iszero ; CHECK-NEXT: %x.wide = sext i8 %x to i32 -; CHECK-NEXT: --> (sext i8 %x to i32) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 %x to i32) U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: %umin = call i8 @llvm.umin.i8(i8 %y, i8 %x) ; CHECK-NEXT: --> (%x umin %y) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %x.is.zero, i8 0, i8 %umin @@ -779,9 +779,9 @@ ; CHECK-NEXT: %umin.narrow = call i8 @llvm.umin.i8(i8 %y, i8 %x) ; CHECK-NEXT: --> (%x umin %y) U: full-set S: full-set ; CHECK-NEXT: %umin = sext i8 %umin.narrow to i32 -; CHECK-NEXT: --> (sext i8 (%x umin %y) to i32) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 (%x umin %y) to i32) U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: %r = select i1 %x.is.zero, i32 0, i32 %umin -; CHECK-NEXT: --> %r U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> %r U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: Determining loop execution counts for: @umin_seq_x_y_sext_of_umin ; %umin.narrow = call i8 @llvm.umin.i8(i8 %y, i8 %x) @@ -797,7 +797,7 @@ ; CHECK-NEXT: %x.zext = zext i8 %x.narrow to i32 ; CHECK-NEXT: --> (zext i8 %x.narrow to i32) U: [0,256) S: [0,256) ; CHECK-NEXT: %x.sext = sext i8 %x.narrow to i32 -; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %y, i32 %x.zext) ; CHECK-NEXT: --> ((zext i8 %x.narrow to i32) umin %y) U: [0,256) S: [0,256) ; CHECK-NEXT: %r = select i1 %x.is.zero, i32 0, i32 %umin @@ -817,7 +817,7 @@ ; CHECK-NEXT: %x.zext = zext i8 %x.narrow to i32 ; CHECK-NEXT: --> (zext i8 %x.narrow to i32) U: [0,256) S: [0,256) ; CHECK-NEXT: %x.sext = sext i8 %x.narrow to i32 -; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 %x.narrow to i32) U: [4294967168,128) S: [-128,128) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %y, i32 %x.sext) ; CHECK-NEXT: --> ((sext i8 %x.narrow to i32) umin %y) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %x.is.zero, i32 0, i32 %umin @@ -836,7 +836,7 @@ ; CHECK-LABEL: 'select_x_or_zero_expanded' ; CHECK-NEXT: Classifying expressions for: @select_x_or_zero_expanded ; CHECK-NEXT: %c.splat = sext i1 %c to i32 -; CHECK-NEXT: --> (sext i1 %c to i32) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 %c to i32) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %c.splat, i32 %x) ; CHECK-NEXT: --> ((sext i1 %c to i32) umin %x) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %v0.is.zero, i32 0, i32 %umin @@ -854,9 +854,9 @@ ; CHECK-LABEL: 'select_zero_or_x_expanded' ; CHECK-NEXT: Classifying expressions for: @select_zero_or_x_expanded ; CHECK-NEXT: %c.splat = sext i1 %c to i32 -; CHECK-NEXT: --> (sext i1 %c to i32) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 %c to i32) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %c.splat.not = xor i32 %c.splat, -1 -; CHECK-NEXT: --> (-1 + (-1 * (sext i1 %c to i32))) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (-1 + (-1 * (sext i1 %c to i32))) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %c.splat.not, i32 %y) ; CHECK-NEXT: --> ((-1 + (-1 * (sext i1 %c to i32))) umin %y) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %v0.is.zero, i32 0, i32 %umin @@ -876,7 +876,7 @@ ; CHECK-NEXT: %c.not = xor i1 %c, true ; CHECK-NEXT: --> (true + %c) U: full-set S: full-set ; CHECK-NEXT: %c.not.splat = sext i1 %c.not to i32 -; CHECK-NEXT: --> (sext i1 (true + %c) to i32) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 (true + %c) to i32) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %c.not.splat, i32 %y) ; CHECK-NEXT: --> ((sext i1 (true + %c) to i32) umin %y) U: full-set S: full-set ; CHECK-NEXT: %r = select i1 %v0.is.zero, i32 0, i32 %umin @@ -895,7 +895,7 @@ ; CHECK-LABEL: 'select_x_or_constant_expanded' ; CHECK-NEXT: Classifying expressions for: @select_x_or_constant_expanded ; CHECK-NEXT: %c.splat = sext i1 %c to i32 -; CHECK-NEXT: --> (sext i1 %c to i32) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 %c to i32) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %x.off = sub i32 %x, 42 ; CHECK-NEXT: --> (-42 + %x) U: full-set S: full-set ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %c.splat, i32 %x.off) @@ -919,9 +919,9 @@ ; CHECK-LABEL: 'select_constant_or_y_expanded' ; CHECK-NEXT: Classifying expressions for: @select_constant_or_y_expanded ; CHECK-NEXT: %c.splat = sext i1 %c to i32 -; CHECK-NEXT: --> (sext i1 %c to i32) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 %c to i32) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %c.splat.not = xor i32 %c.splat, -1 -; CHECK-NEXT: --> (-1 + (-1 * (sext i1 %c to i32))) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (-1 + (-1 * (sext i1 %c to i32))) U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %y.off = sub i32 %y, 42 ; CHECK-NEXT: --> (-42 + %y) U: full-set S: full-set ; CHECK-NEXT: %umin = call i32 @llvm.umin.i32(i32 %c.splat.not, i32 %y.off) diff --git a/llvm/test/Analysis/ScalarEvolution/lshr-shl-differentconstmask.ll b/llvm/test/Analysis/ScalarEvolution/lshr-shl-differentconstmask.ll --- a/llvm/test/Analysis/ScalarEvolution/lshr-shl-differentconstmask.ll +++ b/llvm/test/Analysis/ScalarEvolution/lshr-shl-differentconstmask.ll @@ -6,9 +6,9 @@ ; CHECK-LABEL: 'udiv_biggerLshr' ; CHECK-NEXT: Classifying expressions for: @udiv_biggerLshr ; CHECK-NEXT: %tmp1 = udiv i32 %val, 64 -; CHECK-NEXT: --> (%val /u 64) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> (%val /u 64) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: %tmp2 = mul i32 %tmp1, 16 -; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) +; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) ; CHECK-NEXT: Determining loop execution counts for: @udiv_biggerLshr ; %tmp1 = udiv i32 %val, 64 @@ -20,9 +20,9 @@ ; CHECK-LABEL: 'udiv_biggerShl' ; CHECK-NEXT: Classifying expressions for: @udiv_biggerShl ; CHECK-NEXT: %tmp1 = udiv i32 %val, 16 -; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) +; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: %tmp2 = mul i32 %tmp1, 64 -; CHECK-NEXT: --> (64 * (%val /u 16)) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * (%val /u 16)) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: Determining loop execution counts for: @udiv_biggerShl ; %tmp1 = udiv i32 %val, 16 @@ -36,9 +36,9 @@ ; CHECK-LABEL: 'shifty_biggerLshr' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerLshr ; CHECK-NEXT: %tmp1 = lshr i32 %val, 6 -; CHECK-NEXT: --> (%val /u 64) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> (%val /u 64) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: %tmp2 = shl i32 %tmp1, 4 -; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) +; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerLshr ; %tmp1 = lshr i32 %val, 6 @@ -50,9 +50,9 @@ ; CHECK-LABEL: 'shifty_biggerLshr_lshrexact' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerLshr_lshrexact ; CHECK-NEXT: %tmp1 = lshr exact i32 %val, 6 -; CHECK-NEXT: --> (%val /u 64) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> (%val /u 64) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: %tmp2 = shl i32 %tmp1, 4 -; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) +; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerLshr_lshrexact ; %tmp1 = lshr exact i32 %val, 6 @@ -64,9 +64,9 @@ ; CHECK-LABEL: 'shifty_biggerShr' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerShr ; CHECK-NEXT: %tmp1 = lshr i32 %val, 4 -; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) +; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: %tmp2 = shl i32 %tmp1, 6 -; CHECK-NEXT: --> (64 * (%val /u 16)) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * (%val /u 16)) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerShr ; %tmp1 = lshr i32 %val, 4 @@ -78,9 +78,9 @@ ; CHECK-LABEL: 'shifty_biggerShr_lshrexact' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerShr_lshrexact ; CHECK-NEXT: %tmp1 = lshr exact i32 %val, 4 -; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) +; CHECK-NEXT: --> (%val /u 16) U: [0,268435456) S: [0,268435456) ; CHECK-NEXT: %tmp2 = shl i32 %tmp1, 6 -; CHECK-NEXT: --> (64 * (%val /u 16)) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * (%val /u 16)) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerShr_lshrexact ; %tmp1 = lshr exact i32 %val, 4 @@ -94,9 +94,9 @@ ; CHECK-LABEL: 'masky_biggerLshr' ; CHECK-NEXT: Classifying expressions for: @masky_biggerLshr ; CHECK-NEXT: %tmp1 = lshr i32 %val, 2 -; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) +; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: %tmp2 = and i32 %tmp1, -16 -; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) +; CHECK-NEXT: --> (16 * (%val /u 64)) U: [0,1073741809) S: [0,1073741809) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerLshr ; %tmp1 = lshr i32 %val, 2 @@ -108,7 +108,7 @@ ; CHECK-LABEL: 'masky_biggerLshr_lshrexact' ; CHECK-NEXT: Classifying expressions for: @masky_biggerLshr_lshrexact ; CHECK-NEXT: %tmp1 = lshr exact i32 %val, 2 -; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) +; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerLshr_lshrexact ; %tmp1 = lshr exact i32 %val, 2 @@ -119,9 +119,9 @@ ; CHECK-LABEL: 'masky_biggerShr' ; CHECK-NEXT: Classifying expressions for: @masky_biggerShr ; CHECK-NEXT: %tmp1 = shl i32 %val, 2 -; CHECK-NEXT: --> (4 * %val) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %val) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %tmp2 = and i32 %tmp1, -64 -; CHECK-NEXT: --> (64 * (zext i26 (trunc i32 (%val /u 16) to i26) to i32)) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * (zext i26 (trunc i32 (%val /u 16) to i26) to i32)) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerShr ; %tmp1 = shl i32 %val, 2 @@ -133,7 +133,7 @@ ; CHECK-LABEL: 'masky_biggerShr_lshrexact' ; CHECK-NEXT: Classifying expressions for: @masky_biggerShr_lshrexact ; CHECK-NEXT: %tmp1 = shl i32 %val, 2 -; CHECK-NEXT: --> (4 * %val) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %val) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerShr_lshrexact ; %tmp1 = shl i32 %val, 2 diff --git a/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info-rewrite-expressions.ll b/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info-rewrite-expressions.ll --- a/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info-rewrite-expressions.ll +++ b/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info-rewrite-expressions.ll @@ -101,11 +101,11 @@ ; CHECK-NEXT: %n.vec = and i64 %ext, 28 ; CHECK-NEXT: --> (4 * ((zext i32 (16 umin %N) to i64) /u 4)) U: [0,17) S: [0,17) ; CHECK-NEXT: %index = phi i64 [ 0, %loop.ph ], [ %index.next, %loop ] -; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (4 * ((zext i32 (16 umin %N) to i64) /u 4))) /u 4)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (4 * ((zext i32 (16 umin %N) to i64) /u 4))) /u 4)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %gep = getelementptr inbounds i32, ptr %arr, i64 %index ; CHECK-NEXT: --> {%arr,+,16}<%loop> U: full-set S: full-set Exits: ((16 * ((-4 + (4 * ((zext i32 (16 umin %N) to i64) /u 4))) /u 4)) + %arr) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index.next = add nuw i64 %index, 4 -; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,-3) S: [-9223372036854775808,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * ((zext i32 (16 umin %N) to i64) /u 4))) /u 4))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * ((zext i32 (16 umin %N) to i64) /u 4))) /u 4))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @rewrite_zext_min_max_narrow_check ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + (4 * ((zext i32 (16 umin %N) to i64) /u 4))) /u 4) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4611686018427387903 @@ -149,11 +149,11 @@ ; CHECK-NEXT: %n.vec = and i64 %umin, 28 ; CHECK-NEXT: --> (4 * ((16 umin (zext i32 %N to i64)) /u 4)) U: [0,17) S: [0,17) ; CHECK-NEXT: %index = phi i64 [ 0, %loop.ph ], [ %index.next, %loop ] -; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (4 * ((16 umin (zext i32 %N to i64)) /u 4))) /u 4)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (4 * ((16 umin (zext i32 %N to i64)) /u 4))) /u 4)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %gep = getelementptr inbounds i32, ptr %arr, i64 %index ; CHECK-NEXT: --> {%arr,+,16}<%loop> U: full-set S: full-set Exits: ((16 * ((-4 + (4 * ((16 umin (zext i32 %N to i64)) /u 4))) /u 4)) + %arr) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index.next = add nuw i64 %index, 4 -; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,-3) S: [-9223372036854775808,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * ((16 umin (zext i32 %N to i64)) /u 4))) /u 4))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * ((16 umin (zext i32 %N to i64)) /u 4))) /u 4))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @rewrite_min_max_zext ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + (4 * ((16 umin (zext i32 %N to i64)) /u 4))) /u 4) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4611686018427387903 @@ -191,9 +191,9 @@ ; CHECK-LABEL: 'rewrite_sext_min_max' ; CHECK-NEXT: Classifying expressions for: @rewrite_sext_min_max ; CHECK-NEXT: %smin = call i32 @llvm.smin.i32(i32 %N, i32 16) -; CHECK-NEXT: --> (16 smin %N) U: [-2147483648,17) S: [-2147483648,17) +; CHECK-NEXT: --> (16 smin %N) U: [2147483648,17) S: [-2147483648,17) ; CHECK-NEXT: %ext = sext i32 %smin to i64 -; CHECK-NEXT: --> (sext i32 (16 smin %N) to i64) U: [-2147483648,17) S: [-2147483648,17) +; CHECK-NEXT: --> (sext i32 (16 smin %N) to i64) U: [18446744071562067968,17) S: [-2147483648,17) ; CHECK-NEXT: %n.vec = and i64 %ext, 28 ; CHECK-NEXT: --> (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64)) U: [0,29) S: [0,29) ; CHECK-NEXT: %index = phi i64 [ 0, %loop.ph ], [ %index.next, %loop ] @@ -239,17 +239,17 @@ ; CHECK-LABEL: 'rewrite_sext_min_max_narrow_check' ; CHECK-NEXT: Classifying expressions for: @rewrite_sext_min_max_narrow_check ; CHECK-NEXT: %smin = call i32 @llvm.smin.i32(i32 %N, i32 16) -; CHECK-NEXT: --> (16 smin %N) U: [-2147483648,17) S: [-2147483648,17) +; CHECK-NEXT: --> (16 smin %N) U: [2147483648,17) S: [-2147483648,17) ; CHECK-NEXT: %ext = sext i32 %smin to i64 -; CHECK-NEXT: --> (sext i32 (16 smin %N) to i64) U: [-2147483648,17) S: [-2147483648,17) +; CHECK-NEXT: --> (sext i32 (16 smin %N) to i64) U: [18446744071562067968,17) S: [-2147483648,17) ; CHECK-NEXT: %n.vec = and i64 %ext, 28 ; CHECK-NEXT: --> (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64)) U: [0,29) S: [0,29) ; CHECK-NEXT: %index = phi i64 [ 0, %loop.ph ], [ %index.next, %loop ] -; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,-9223372036854775808) S: [0,9223372036854775805) Exits: (4 * ((-4 + (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64))) /u 4)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,9223372036854775808) S: [0,9223372036854775805) Exits: (4 * ((-4 + (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64))) /u 4)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %gep = getelementptr inbounds i32, ptr %arr, i64 %index ; CHECK-NEXT: --> {%arr,+,16}<%loop> U: full-set S: full-set Exits: ((16 * ((-4 + (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64))) /u 4)) + %arr) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index.next = add nsw i64 %index, 4 -; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,-9223372036854775808) S: [4,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64))) /u 4))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,9223372036854775808) S: [4,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64))) /u 4))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @rewrite_sext_min_max_narrow_check ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + (4 * (zext i3 (trunc i64 ((sext i32 (16 smin %N) to i64) /u 4) to i3) to i64))) /u 4) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4611686018427387903 @@ -287,17 +287,17 @@ ; CHECK-LABEL: 'rewrite_min_max_sext' ; CHECK-NEXT: Classifying expressions for: @rewrite_min_max_sext ; CHECK-NEXT: %N.wide = sext i32 %N to i64 -; CHECK-NEXT: --> (sext i32 %N to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %N to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %smin = call i64 @llvm.smin.i64(i64 %N.wide, i64 16) -; CHECK-NEXT: --> (16 smin (sext i32 %N to i64)) U: [-2147483648,17) S: [-2147483648,17) +; CHECK-NEXT: --> (16 smin (sext i32 %N to i64)) U: [18446744071562067968,17) S: [-2147483648,17) ; CHECK-NEXT: %n.vec = and i64 %smin, 28 ; CHECK-NEXT: --> (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64)) U: [0,29) S: [0,29) ; CHECK-NEXT: %index = phi i64 [ 0, %loop.ph ], [ %index.next, %loop ] -; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,-9223372036854775808) S: [0,9223372036854775805) Exits: (4 * ((-4 + (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64))) /u 4)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,9223372036854775808) S: [0,9223372036854775805) Exits: (4 * ((-4 + (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64))) /u 4)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %gep = getelementptr inbounds i32, ptr %arr, i64 %index ; CHECK-NEXT: --> {%arr,+,16}<%loop> U: full-set S: full-set Exits: ((16 * ((-4 + (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64))) /u 4)) + %arr) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index.next = add nsw i64 %index, 4 -; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,-9223372036854775808) S: [4,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64))) /u 4))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,9223372036854775808) S: [4,9223372036854775805) Exits: (4 + (4 * ((-4 + (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64))) /u 4))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @rewrite_min_max_sext ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + (4 * (zext i3 (trunc i64 ((16 smin (sext i32 %N to i64)) /u 4) to i3) to i64))) /u 4) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4611686018427387903 @@ -337,7 +337,7 @@ ; CHECK-NEXT: %and = and i32 %N, 3 ; CHECK-NEXT: --> (zext i2 (trunc i32 %N to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %and.sub.1 = add nsw i32 %and, -1 -; CHECK-NEXT: --> (-1 + (zext i2 (trunc i32 %N to i2) to i32)) U: [-1,3) S: [-1,3) +; CHECK-NEXT: --> (-1 + (zext i2 (trunc i32 %N to i2) to i32)) U: [4294967295,3) S: [-1,3) ; CHECK-NEXT: %ext = zext i32 %and.sub.1 to i64 ; CHECK-NEXT: --> (zext i32 (-1 + (zext i2 (trunc i32 %N to i2) to i32)) to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %n.rnd.up = add nuw nsw i64 %ext, 4 @@ -387,7 +387,7 @@ ; CHECK-NEXT: %and = and i32 %N, 3 ; CHECK-NEXT: --> (zext i2 (trunc i32 %N to i2) to i32) U: [0,4) S: [0,4) ; CHECK-NEXT: %and.sub.1 = add nsw i32 %and, -1 -; CHECK-NEXT: --> (-1 + (zext i2 (trunc i32 %N to i2) to i32)) U: [-1,3) S: [-1,3) +; CHECK-NEXT: --> (-1 + (zext i2 (trunc i32 %N to i2) to i32)) U: [4294967295,3) S: [-1,3) ; CHECK-NEXT: %ext = zext i32 %and.sub.1 to i64 ; CHECK-NEXT: --> (zext i32 (-1 + (zext i2 (trunc i32 %N to i2) to i32)) to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %n.rnd.up = add nuw nsw i64 %ext, 4 diff --git a/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll b/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll --- a/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll +++ b/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll @@ -387,11 +387,11 @@ ; CHECK-LABEL: 'test_multiple_var_guards_cycle' ; CHECK-NEXT: Classifying expressions for: @test_multiple_var_guards_cycle ; CHECK-NEXT: %iv = phi i64 [ %iv.next, %loop ], [ 0, %guardbb ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: %N LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: %N LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %idx = getelementptr inbounds i32, ptr %a, i64 %iv ; CHECK-NEXT: --> {%a,+,4}<%loop> U: full-set S: full-set Exits: ((4 * %N) + %a) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add nuw nsw i64 %iv, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-1) S: [1,-1) Exits: (1 + %N) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,18446744073709551615) S: [1,-1) Exits: (1 + %N) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_multiple_var_guards_cycle ; CHECK-NEXT: Loop %loop: backedge-taken count is %N ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -3 @@ -1024,9 +1024,9 @@ ; CHECK-NEXT: %shr = lshr i32 %blockSize, 2 ; CHECK-NEXT: --> (%blockSize /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: %iv = phi i32 [ %dec, %while.body ], [ %shr, %while.body.preheader ] -; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [-1073741822,1073741824) S: [-1073741822,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [3221225474,1073741824) S: [-1073741822,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: %dec = add i32 %iv, -1 -; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [-1073741823,1073741823) S: [-1073741823,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [3221225473,1073741823) S: [-1073741823,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_guard_uge ; CHECK-NEXT: Loop %while.body: backedge-taken count is (-1 + (%blockSize /u 4)) ; CHECK-NEXT: Loop %while.body: constant max backedge-taken count is 1073741822 @@ -1061,9 +1061,9 @@ ; CHECK-NEXT: %shr = lshr i32 %blockSize, 2 ; CHECK-NEXT: --> (%blockSize /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: %iv = phi i32 [ %dec, %while.body ], [ %shr, %while.body.preheader ] -; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [-1073741822,1073741824) S: [-1073741822,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [3221225474,1073741824) S: [-1073741822,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: %dec = add i32 %iv, -1 -; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [-1073741823,1073741823) S: [-1073741823,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [3221225473,1073741823) S: [-1073741823,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_guard_ugt ; CHECK-NEXT: Loop %while.body: backedge-taken count is (-1 + (%blockSize /u 4)) ; CHECK-NEXT: Loop %while.body: constant max backedge-taken count is 1073741822 @@ -1098,9 +1098,9 @@ ; CHECK-NEXT: %shr = lshr i32 %blockSize, 2 ; CHECK-NEXT: --> (%blockSize /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: %iv = phi i32 [ %dec, %while.body ], [ %shr, %while.body.preheader ] -; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [-255,1073741824) S: [-255,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [4294967041,1073741824) S: [-255,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: %dec = add i32 %iv, -1 -; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [-256,1073741823) S: [-256,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [4294967040,1073741823) S: [-256,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_guard_uge_and_ule ; CHECK-NEXT: Loop %while.body: backedge-taken count is (-1 + (%blockSize /u 4)) ; CHECK-NEXT: Loop %while.body: constant max backedge-taken count is 255 @@ -1139,9 +1139,9 @@ ; CHECK-NEXT: %shr = lshr i32 %blockSize, 2 ; CHECK-NEXT: --> (%blockSize /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: %iv = phi i32 [ %dec, %while.body ], [ %shr, %while.body.preheader ] -; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [-255,1073741824) S: [-255,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(%blockSize /u 4),+,-1}<%while.body> U: [4294967041,1073741824) S: [-255,1073741824) Exits: 1 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: %dec = add i32 %iv, -1 -; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [-256,1073741823) S: [-256,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } +; CHECK-NEXT: --> {(-1 + (%blockSize /u 4)),+,-1}<%while.body> U: [4294967040,1073741823) S: [-256,1073741823) Exits: 0 LoopDispositions: { %while.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_guard_ugt_and_ult ; CHECK-NEXT: Loop %while.body: backedge-taken count is (-1 + (%blockSize /u 4)) ; CHECK-NEXT: Loop %while.body: constant max backedge-taken count is 255 @@ -1486,11 +1486,11 @@ ; CHECK-NEXT: %N.off = add i32 %N, -1 ; CHECK-NEXT: --> (-1 + %N) U: full-set S: full-set ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %N) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %N) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %gep = getelementptr inbounds i16, ptr %pred, i32 %iv ; CHECK-NEXT: --> {%pred,+,2}<%loop> U: full-set S: full-set Exits: ((2 * (zext i32 (-1 + %N) to i64)) + %pred) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add nuw nsw i32 %iv, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %N LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %N LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @not_optimized_range_check_unsigned1 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %N) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -2 @@ -1524,11 +1524,11 @@ ; CHECK-NEXT: %N.off = add i32 %N, -1 ; CHECK-NEXT: --> (-1 + %N) U: full-set S: full-set ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %N) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %N) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %gep = getelementptr inbounds i16, ptr %pred, i32 %iv ; CHECK-NEXT: --> {%pred,+,2}<%loop> U: full-set S: full-set Exits: ((2 * (zext i32 (-1 + %N) to i64)) + %pred) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add nuw nsw i32 %iv, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %N LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %N LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @not_optimized_range_check_unsigned2 ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + %N) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -2 @@ -1596,9 +1596,9 @@ ; CHECK-LABEL: 'ult_sle_sgt_umax_to_smax' ; CHECK-NEXT: Classifying expressions for: @ult_sle_sgt_umax_to_smax ; CHECK-NEXT: %iv = phi i32 [ 0, %guard.3 ], [ %iv.next, %loop ] -; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,-3) S: [-2147483648,2147483645) Exits: (4 * ((-4 + %num) /u 4)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,4}<%loop> U: [0,4294967293) S: [-2147483648,2147483645) Exits: (4 * ((-4 + %num) /u 4)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add nuw i32 %iv, 4 -; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,-3) S: [-2147483648,2147483645) Exits: (4 + (4 * ((-4 + %num) /u 4))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {4,+,4}<%loop> U: [4,4294967293) S: [-2147483648,2147483645) Exits: (4 + (4 * ((-4 + %num) /u 4))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @ult_sle_sgt_umax_to_smax ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-4 + %num) /u 4) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 1073741823 diff --git a/llvm/test/Analysis/ScalarEvolution/max-be-count-not-constant.ll b/llvm/test/Analysis/ScalarEvolution/max-be-count-not-constant.ll --- a/llvm/test/Analysis/ScalarEvolution/max-be-count-not-constant.ll +++ b/llvm/test/Analysis/ScalarEvolution/max-be-count-not-constant.ll @@ -12,7 +12,7 @@ ; CHECK-LABEL: 'pluto' ; CHECK-NEXT: Classifying expressions for: @pluto ; CHECK-NEXT: %tmp = ashr i32 %arg, 31 -; CHECK-NEXT: --> %tmp U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> %tmp U: [4294967295,1) S: [-1,1) ; CHECK-NEXT: %tmp1 = add nsw i32 %tmp, 2 ; CHECK-NEXT: --> (2 + %tmp) U: [1,3) S: [1,3) ; CHECK-NEXT: %tmp3 = phi i32 [ 0, %bb ], [ %tmp4, %bb2 ] diff --git a/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll b/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll --- a/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll +++ b/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll @@ -11,63 +11,63 @@ ; CHECK-LABEL: 'smax' ; CHECK-NEXT: Classifying expressions for: @smax ; CHECK-NEXT: %tmp5 = phi i64 [ %tmp62, %bb61 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%bb4> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> {0,+,1}<%bb4> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp6 = trunc i64 %tmp5 to i32 ; CHECK-NEXT: --> {0,+,1}<%bb4> U: full-set S: full-set Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp7 = shl nsw i32 %tmp6, 8 -; CHECK-NEXT: --> {0,+,256}<%bb4> U: [0,-255) S: [-2147483648,2147483393) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> {0,+,256}<%bb4> U: [0,4294967041) S: [-2147483648,2147483393) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp8 = sub nsw i32 %tmp3, %tmp7 ; CHECK-NEXT: --> {%tmp3,+,-256}<%bb4> U: full-set S: full-set Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp10 = select i1 %tmp9, i32 %tmp8, i32 256 -; CHECK-NEXT: --> (256 smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp11 = add nsw i32 %tmp10, 1 -; CHECK-NEXT: --> (1 + (256 smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp13 = select i1 %tmp12, i32 %tmp11, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp15 = select i1 %tmp14, i32 %tmp13, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp16 = add nsw i32 %tmp15, 1 -; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp18 = select i1 %tmp17, i32 %tmp16, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp20 = select i1 %tmp19, i32 %tmp18, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp21 = add nsw i32 %tmp20, 1 -; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp23 = select i1 %tmp22, i32 %tmp21, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp25 = select i1 %tmp24, i32 %tmp23, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp26 = add nsw i32 %tmp25, 1 -; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp28 = select i1 %tmp27, i32 %tmp26, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp30 = select i1 %tmp29, i32 %tmp28, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp31 = add nsw i32 %tmp30, 1 -; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp33 = select i1 %tmp32, i32 %tmp31, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp35 = select i1 %tmp34, i32 %tmp33, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp36 = add nsw i32 %tmp35, 1 -; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp38 = select i1 %tmp37, i32 %tmp36, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp40 = select i1 %tmp39, i32 %tmp38, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp41 = add nsw i32 %tmp40, 1 -; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483647,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483649,258) S: [-2147483647,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp43 = select i1 %tmp42, i32 %tmp41, i32 %tmp8 -; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,258) S: [-2147483648,258) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp44 = add nsw i32 %tmp10, 7 -; CHECK-NEXT: --> (7 + (256 smin {%tmp3,+,-256}<%bb4>)) U: [-2147483641,264) S: [-2147483641,264) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (7 + (256 smin {%tmp3,+,-256}<%bb4>)) U: [2147483655,264) S: [-2147483641,264) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp46 = select i1 %tmp45, i32 %tmp43, i32 256 -; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>) U: [2147483648,257) S: [-2147483648,257) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp48 = select i1 %tmp47, i32 %tmp44, i32 %tmp46 -; CHECK-NEXT: --> ((7 + (256 smin {%tmp3,+,-256}<%bb4>)) smax (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [-2147483641,264) S: [-2147483641,264) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> ((7 + (256 smin {%tmp3,+,-256}<%bb4>)) smax (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) smin {%tmp3,+,-256}<%bb4>)) U: [2147483655,264) S: [-2147483641,264) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp49 = ashr i32 %tmp48, 3 -; CHECK-NEXT: --> %tmp49 U: [-268435456,268435456) S: [-268435456,268435456) Exits: <> LoopDispositions: { %bb4: Variant, %bb53: Invariant } +; CHECK-NEXT: --> %tmp49 U: [4026531840,268435456) S: [-268435456,268435456) Exits: <> LoopDispositions: { %bb4: Variant, %bb53: Invariant } ; CHECK-NEXT: %tmp51 = select i1 %tmp50, i32 %tmp49, i32 0 ; CHECK-NEXT: --> (0 smax %tmp49) U: [0,268435456) S: [0,268435456) Exits: <> LoopDispositions: { %bb4: Variant, %bb53: Invariant } ; CHECK-NEXT: %tmp52 = zext i32 %tmp51 to i64 @@ -77,11 +77,11 @@ ; CHECK-NEXT: %tmp55 = trunc i64 %tmp54 to i32 ; CHECK-NEXT: --> {(trunc i64 undef to i32),+,1}<%bb53> U: full-set S: full-set Exits: (-1 + (0 smax %tmp49)) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp56 = shl nsw i32 %tmp55, 3 -; CHECK-NEXT: --> {(8 * (trunc i64 undef to i32)),+,8}<%bb53> U: [0,-7) S: [-2147483648,2147483641) Exits: (-8 + (8 * (0 smax %tmp49))) LoopDispositions: { %bb53: Computable, %bb4: Variant } +; CHECK-NEXT: --> {(8 * (trunc i64 undef to i32)),+,8}<%bb53> U: [0,4294967289) S: [-2147483648,2147483641) Exits: (-8 + (8 * (0 smax %tmp49))) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp57 = sext i32 %tmp56 to i64 -; CHECK-NEXT: --> (sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) U: [0,-7) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 (0 smax %tmp49) to i64))) LoopDispositions: { %bb53: Computable, %bb4: Variant } +; CHECK-NEXT: --> (sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) U: [0,18446744073709551609) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 (0 smax %tmp49) to i64))) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp58 = getelementptr inbounds i8, ptr null, i64 %tmp57 -; CHECK-NEXT: --> ((sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) + null) U: [0,-7) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 (0 smax %tmp49) to i64)) + null) LoopDispositions: { %bb53: Computable, %bb4: Variant } +; CHECK-NEXT: --> ((sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) + null) U: [0,18446744073709551609) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 (0 smax %tmp49) to i64)) + null) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp59 = add nsw i64 %tmp54, 1 ; CHECK-NEXT: --> {(1 + undef),+,1}<%bb53> U: full-set S: full-set Exits: (zext i32 (0 smax %tmp49) to i64) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp62 = add nuw nsw i64 %tmp5, 1 @@ -173,11 +173,11 @@ ; CHECK-LABEL: 'umax' ; CHECK-NEXT: Classifying expressions for: @umax ; CHECK-NEXT: %tmp5 = phi i64 [ %tmp62, %bb61 ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%bb4> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> {0,+,1}<%bb4> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp6 = trunc i64 %tmp5 to i32 ; CHECK-NEXT: --> {0,+,1}<%bb4> U: full-set S: full-set Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp7 = shl nsw i32 %tmp6, 8 -; CHECK-NEXT: --> {0,+,256}<%bb4> U: [0,-255) S: [-2147483648,2147483393) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } +; CHECK-NEXT: --> {0,+,256}<%bb4> U: [0,4294967041) S: [-2147483648,2147483393) Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp8 = sub nsw i32 %tmp3, %tmp7 ; CHECK-NEXT: --> {%tmp3,+,-256}<%bb4> U: full-set S: full-set Exits: <> LoopDispositions: { %bb4: Computable, %bb53: Invariant } ; CHECK-NEXT: %tmp10 = select i1 %tmp9, i32 %tmp8, i32 256 @@ -239,11 +239,11 @@ ; CHECK-NEXT: %tmp55 = trunc i64 %tmp54 to i32 ; CHECK-NEXT: --> {(trunc i64 undef to i32),+,1}<%bb53> U: full-set S: full-set Exits: (-1 + %tmp49) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp56 = shl nsw i32 %tmp55, 3 -; CHECK-NEXT: --> {(8 * (trunc i64 undef to i32)),+,8}<%bb53> U: [0,-7) S: [-2147483648,2147483641) Exits: (-8 + (8 * %tmp49)) LoopDispositions: { %bb53: Computable, %bb4: Variant } +; CHECK-NEXT: --> {(8 * (trunc i64 undef to i32)),+,8}<%bb53> U: [0,4294967289) S: [-2147483648,2147483641) Exits: (-8 + (8 * %tmp49)) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp57 = sext i32 %tmp56 to i64 -; CHECK-NEXT: --> (sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) U: [0,-7) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 %tmp49 to i64))) LoopDispositions: { %bb53: Computable, %bb4: Variant } +; CHECK-NEXT: --> (sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) U: [0,18446744073709551609) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 %tmp49 to i64))) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp58 = getelementptr inbounds i8, ptr null, i64 %tmp57 -; CHECK-NEXT: --> ((sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) + null) U: [0,-7) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 %tmp49 to i64)) + null) LoopDispositions: { %bb53: Computable, %bb4: Variant } +; CHECK-NEXT: --> ((sext i32 {(8 * (trunc i64 undef to i32)),+,8}<%bb53> to i64) + null) U: [0,18446744073709551609) S: [-2147483648,2147483641) Exits: (-8 + (8 * (zext i32 %tmp49 to i64)) + null) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp59 = add nsw i64 %tmp54, 1 ; CHECK-NEXT: --> {(1 + undef),+,1}<%bb53> U: full-set S: full-set Exits: (zext i32 %tmp49 to i64) LoopDispositions: { %bb53: Computable, %bb4: Variant } ; CHECK-NEXT: %tmp62 = add nuw nsw i64 %tmp5, 1 diff --git a/llvm/test/Analysis/ScalarEvolution/min-max-exprs.ll b/llvm/test/Analysis/ScalarEvolution/min-max-exprs.ll --- a/llvm/test/Analysis/ScalarEvolution/min-max-exprs.ll +++ b/llvm/test/Analysis/ScalarEvolution/min-max-exprs.ll @@ -20,31 +20,31 @@ ; CHECK-LABEL: 'f' ; CHECK-NEXT: Classifying expressions for: @f ; CHECK-NEXT: %i.0 = phi i32 [ 0, %bb ], [ %tmp23, %bb2 ] -; CHECK-NEXT: --> {0,+,1}<%bb1> U: [0,-2147483648) S: [0,-2147483648) Exits: (0 smax %N) LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> {0,+,1}<%bb1> U: [0,2147483648) S: [0,-2147483648) Exits: (0 smax %N) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %i.0.1 = sext i32 %i.0 to i64 ; CHECK-NEXT: --> {0,+,1}<%bb1> U: [0,2147483648) S: [0,2147483648) Exits: (zext i32 (0 smax %N) to i64) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp3 = add nuw nsw i32 %i.0, 3 -; CHECK-NEXT: --> {3,+,1}<%bb1> U: [3,-2147483645) S: [3,-2147483645) Exits: (3 + (0 smax %N)) LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> {3,+,1}<%bb1> U: [3,2147483651) S: [3,-2147483645) Exits: (3 + (0 smax %N)) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp5 = sext i32 %tmp3 to i64 -; CHECK-NEXT: --> (sext i32 {3,+,1}<%bb1> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 (3 + (0 smax %N)) to i64) LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> (sext i32 {3,+,1}<%bb1> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 (3 + (0 smax %N)) to i64) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp6 = sext i32 %N to i64 -; CHECK-NEXT: --> (sext i32 %N to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %N to i64) LoopDispositions: { %bb1: Invariant } +; CHECK-NEXT: --> (sext i32 %N to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %N to i64) LoopDispositions: { %bb1: Invariant } ; CHECK-NEXT: %tmp9 = select i1 %tmp4, i64 %tmp5, i64 %tmp6 -; CHECK-NEXT: --> ((sext i32 {3,+,1}<%bb1> to i64) smin (sext i32 %N to i64)) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: ((sext i32 (3 + (0 smax %N)) to i64) smin (sext i32 %N to i64)) LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> ((sext i32 {3,+,1}<%bb1> to i64) smin (sext i32 %N to i64)) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: ((sext i32 (3 + (0 smax %N)) to i64) smin (sext i32 %N to i64)) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp11 = getelementptr inbounds i32, ptr %A, i64 %tmp9 ; CHECK-NEXT: --> ((4 * ((sext i32 {3,+,1}<%bb1> to i64) smin (sext i32 %N to i64))) + %A) U: full-set S: full-set Exits: ((4 * ((sext i32 (3 + (0 smax %N)) to i64) smin (sext i32 %N to i64))) + %A) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp12 = load i32, ptr %tmp11, align 4 ; CHECK-NEXT: --> %tmp12 U: full-set S: full-set Exits: <> LoopDispositions: { %bb1: Variant } ; CHECK-NEXT: %tmp13 = shl nsw i32 %tmp12, 1 -; CHECK-NEXT: --> (2 * %tmp12) U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb1: Variant } +; CHECK-NEXT: --> (2 * %tmp12) U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb1: Variant } ; CHECK-NEXT: %tmp17 = add nsw i64 %i.0.1, -3 -; CHECK-NEXT: --> {-3,+,1}<%bb1> U: [-3,2147483645) S: [-3,2147483645) Exits: (-3 + (zext i32 (0 smax %N) to i64)) LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> {-3,+,1}<%bb1> U: [18446744073709551613,2147483645) S: [-3,2147483645) Exits: (-3 + (zext i32 (0 smax %N) to i64)) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp19 = select i1 %tmp14, i64 0, i64 %tmp17 ; CHECK-NEXT: --> (-3 + (3 smax {0,+,1}<%bb1>)) U: [0,2147483645) S: [0,2147483645) Exits: (-3 + (3 smax (zext i32 (0 smax %N) to i64))) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp21 = getelementptr inbounds i32, ptr %A, i64 %tmp19 ; CHECK-NEXT: --> (-12 + (4 * (3 smax {0,+,1}<%bb1>)) + %A) U: full-set S: full-set Exits: (-12 + (4 * (3 smax (zext i32 (0 smax %N) to i64))) + %A) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp23 = add nuw nsw i32 %i.0, 1 -; CHECK-NEXT: --> {1,+,1}<%bb1> U: [1,-2147483647) S: [1,-2147483647) Exits: (1 + (0 smax %N)) LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> {1,+,1}<%bb1> U: [1,2147483649) S: [1,-2147483647) Exits: (1 + (0 smax %N)) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f ; CHECK-NEXT: Loop %bb1: backedge-taken count is (0 smax %N) ; CHECK-NEXT: Loop %bb1: constant max backedge-taken count is 2147483647 diff --git a/llvm/test/Analysis/ScalarEvolution/mul.ll b/llvm/test/Analysis/ScalarEvolution/mul.ll --- a/llvm/test/Analysis/ScalarEvolution/mul.ll +++ b/llvm/test/Analysis/ScalarEvolution/mul.ll @@ -19,9 +19,9 @@ ; CHECK-LABEL: 'test2' ; CHECK-NEXT: Classifying expressions for: @test2 ; CHECK-NEXT: %udiv = udiv i8 %x, 2 -; CHECK-NEXT: --> (%x /u 2) U: [0,-128) S: [0,-128) +; CHECK-NEXT: --> (%x /u 2) U: [0,128) S: [0,-128) ; CHECK-NEXT: %res = mul i8 %udiv, 2 -; CHECK-NEXT: --> (2 * (%x /u 2)) U: [0,-1) S: [-128,127) +; CHECK-NEXT: --> (2 * (%x /u 2)) U: [0,255) S: [-128,127) ; CHECK-NEXT: Determining loop execution counts for: @test2 ; %udiv = udiv i8 %x, 2 @@ -35,7 +35,7 @@ ; CHECK-NEXT: %udiv = udiv i8 %x, -128 ; CHECK-NEXT: --> (%x /u -128) U: [0,2) S: [0,2) ; CHECK-NEXT: %res = mul i8 %udiv, -128 -; CHECK-NEXT: --> (-128 * (%x /u -128)) U: [0,-127) S: [-128,1) +; CHECK-NEXT: --> (-128 * (%x /u -128)) U: [0,129) S: [-128,1) ; CHECK-NEXT: Determining loop execution counts for: @test3 ; %udiv = udiv i8 %x, 128 @@ -49,7 +49,7 @@ ; CHECK-NEXT: %udiv = udiv i8 %x, -1 ; CHECK-NEXT: --> (%x /u -1) U: [0,2) S: [0,2) ; CHECK-NEXT: %res = mul i8 %udiv, -1 -; CHECK-NEXT: --> (-1 * (%x /u -1)) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (-1 * (%x /u -1)) U: [255,1) S: [-1,1) ; CHECK-NEXT: Determining loop execution counts for: @test4 ; %udiv = udiv i8 %x, 255 diff --git a/llvm/test/Analysis/ScalarEvolution/no-wrap-add-exprs.ll b/llvm/test/Analysis/ScalarEvolution/no-wrap-add-exprs.ll --- a/llvm/test/Analysis/ScalarEvolution/no-wrap-add-exprs.ll +++ b/llvm/test/Analysis/ScalarEvolution/no-wrap-add-exprs.ll @@ -11,13 +11,13 @@ ; CHECK-NEXT: %len_norange = load i8, ptr %len_addr, align 1 ; CHECK-NEXT: --> %len_norange U: full-set S: full-set ; CHECK-NEXT: %t0 = add i8 %len, 1 -; CHECK-NEXT: --> (1 + %len) U: [1,-128) S: [1,-128) +; CHECK-NEXT: --> (1 + %len) U: [1,128) S: [1,-128) ; CHECK-NEXT: %t1 = add i8 %len, 2 -; CHECK-NEXT: --> (2 + %len) U: [2,-127) S: [2,-127) +; CHECK-NEXT: --> (2 + %len) U: [2,129) S: [2,-127) ; CHECK-NEXT: %t2 = sub i8 %len, 1 -; CHECK-NEXT: --> (-1 + %len) U: [-1,126) S: [-1,126) +; CHECK-NEXT: --> (-1 + %len) U: [255,126) S: [-1,126) ; CHECK-NEXT: %t3 = sub i8 %len, 2 -; CHECK-NEXT: --> (-2 + %len) U: [-2,125) S: [-2,125) +; CHECK-NEXT: --> (-2 + %len) U: [254,125) S: [-2,125) ; CHECK-NEXT: %q0 = add i8 %len_norange, 1 ; CHECK-NEXT: --> (1 + %len_norange) U: full-set S: full-set ; CHECK-NEXT: %q1 = add i8 %len_norange, 2 @@ -55,21 +55,21 @@ ; CHECK-NEXT: %len_norange = load i8, ptr %len_addr, align 1 ; CHECK-NEXT: --> %len_norange U: full-set S: full-set ; CHECK-NEXT: %t0 = add i8 %len, -1 -; CHECK-NEXT: --> (-1 + %len) U: [-1,126) S: [-1,126) +; CHECK-NEXT: --> (-1 + %len) U: [255,126) S: [-1,126) ; CHECK-NEXT: %t1 = add i8 %len, -2 -; CHECK-NEXT: --> (-2 + %len) U: [-2,125) S: [-2,125) +; CHECK-NEXT: --> (-2 + %len) U: [254,125) S: [-2,125) ; CHECK-NEXT: %t0.sext = sext i8 %t0 to i16 -; CHECK-NEXT: --> (-1 + (zext i8 %len to i16)) U: [-1,126) S: [-1,126) +; CHECK-NEXT: --> (-1 + (zext i8 %len to i16)) U: [65535,126) S: [-1,126) ; CHECK-NEXT: %t1.sext = sext i8 %t1 to i16 -; CHECK-NEXT: --> (-2 + (zext i8 %len to i16)) U: [-2,125) S: [-2,125) +; CHECK-NEXT: --> (-2 + (zext i8 %len to i16)) U: [65534,125) S: [-2,125) ; CHECK-NEXT: %q0 = add i8 %len_norange, 1 ; CHECK-NEXT: --> (1 + %len_norange) U: full-set S: full-set ; CHECK-NEXT: %q1 = add i8 %len_norange, 2 ; CHECK-NEXT: --> (2 + %len_norange) U: full-set S: full-set ; CHECK-NEXT: %q0.sext = sext i8 %q0 to i16 -; CHECK-NEXT: --> (sext i8 (1 + %len_norange) to i16) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 (1 + %len_norange) to i16) U: [65408,128) S: [-128,128) ; CHECK-NEXT: %q1.sext = sext i8 %q1 to i16 -; CHECK-NEXT: --> (sext i8 (2 + %len_norange) to i16) U: [-128,128) S: [-128,128) +; CHECK-NEXT: --> (sext i8 (2 + %len_norange) to i16) U: [65408,128) S: [-128,128) ; CHECK-NEXT: Determining loop execution counts for: @f1 ; entry: @@ -99,9 +99,9 @@ ; CHECK-NEXT: %len_norange = load i8, ptr %len_addr, align 1 ; CHECK-NEXT: --> %len_norange U: full-set S: full-set ; CHECK-NEXT: %t0 = add i8 %len, 1 -; CHECK-NEXT: --> (1 + %len) U: [1,-128) S: [1,-128) +; CHECK-NEXT: --> (1 + %len) U: [1,128) S: [1,-128) ; CHECK-NEXT: %t1 = add i8 %len, 2 -; CHECK-NEXT: --> (2 + %len) U: [2,-127) S: [2,-127) +; CHECK-NEXT: --> (2 + %len) U: [2,129) S: [2,-127) ; CHECK-NEXT: %t0.zext = zext i8 %t0 to i16 ; CHECK-NEXT: --> (1 + (zext i8 %len to i16)) U: [1,128) S: [1,128) ; CHECK-NEXT: %t1.zext = zext i8 %t1 to i16 @@ -147,45 +147,45 @@ ; CHECK-NEXT: %x = load i8, ptr %x_addr, align 1 ; CHECK-NEXT: --> %x U: full-set S: full-set ; CHECK-NEXT: %t0 = mul i8 %x, 4 -; CHECK-NEXT: --> (4 * %x) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (4 * %x) U: [0,253) S: [-128,125) ; CHECK-NEXT: %t1 = add i8 %t0, 5 ; CHECK-NEXT: --> (5 + (4 * %x)) U: [5,2) S: [-123,-126) ; CHECK-NEXT: %t1.zext = zext i8 %t1 to i16 ; CHECK-NEXT: --> (1 + (zext i8 (4 + (4 * %x)) to i16)) U: [1,254) S: [1,257) ; CHECK-NEXT: %q0 = mul i8 %x, 4 -; CHECK-NEXT: --> (4 * %x) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (4 * %x) U: [0,253) S: [-128,125) ; CHECK-NEXT: %q1 = add i8 %q0, 7 ; CHECK-NEXT: --> (7 + (4 * %x)) U: [7,4) S: [-121,-124) ; CHECK-NEXT: %q1.zext = zext i8 %q1 to i16 ; CHECK-NEXT: --> (3 + (zext i8 (4 + (4 * %x)) to i16)) U: [3,256) S: [3,259) ; CHECK-NEXT: %p0 = mul i8 %x, 4 -; CHECK-NEXT: --> (4 * %x) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (4 * %x) U: [0,253) S: [-128,125) ; CHECK-NEXT: %p1 = add i8 %p0, 8 -; CHECK-NEXT: --> (8 + (4 * %x)) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (8 + (4 * %x)) U: [0,253) S: [-128,125) ; CHECK-NEXT: %p1.zext = zext i8 %p1 to i16 ; CHECK-NEXT: --> (zext i8 (8 + (4 * %x)) to i16) U: [0,253) S: [0,256) ; CHECK-NEXT: %r0 = mul i8 %x, 4 -; CHECK-NEXT: --> (4 * %x) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (4 * %x) U: [0,253) S: [-128,125) ; CHECK-NEXT: %r1 = add i8 %r0, -2 -; CHECK-NEXT: --> (-2 + (4 * %x)) U: [0,-1) S: [-128,127) +; CHECK-NEXT: --> (-2 + (4 * %x)) U: [0,255) S: [-128,127) ; CHECK-NEXT: %r1.zext = zext i8 %r1 to i16 ; CHECK-NEXT: --> (2 + (zext i8 (-4 + (4 * %x)) to i16)) U: [2,255) S: [2,258) ; CHECK-NEXT: %y = load i8, ptr %y_addr, align 1 ; CHECK-NEXT: --> %y U: full-set S: full-set ; CHECK-NEXT: %s0 = mul i8 %x, 32 -; CHECK-NEXT: --> (32 * %x) U: [0,-31) S: [-128,97) +; CHECK-NEXT: --> (32 * %x) U: [0,225) S: [-128,97) ; CHECK-NEXT: %s1 = mul i8 %y, 36 -; CHECK-NEXT: --> (36 * %y) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> (36 * %y) U: [0,253) S: [-128,125) ; CHECK-NEXT: %s2 = add i8 %s0, %s1 -; CHECK-NEXT: --> ((32 * %x) + (36 * %y)) U: [0,-3) S: [-128,125) +; CHECK-NEXT: --> ((32 * %x) + (36 * %y)) U: [0,253) S: [-128,125) ; CHECK-NEXT: %s3 = add i8 %s2, 5 ; CHECK-NEXT: --> (5 + (32 * %x) + (36 * %y)) U: full-set S: full-set ; CHECK-NEXT: %s3.zext = zext i8 %s3 to i16 ; CHECK-NEXT: --> (1 + (zext i8 (4 + (32 * %x) + (36 * %y)) to i16)) U: [1,254) S: [1,257) ; CHECK-NEXT: %ptr = bitcast ptr @z_addr to ptr -; CHECK-NEXT: --> @z_addr U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> @z_addr U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %int0 = ptrtoint ptr %ptr to i32 -; CHECK-NEXT: --> (trunc i64 (ptrtoint ptr @z_addr to i64) to i32) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (trunc i64 (ptrtoint ptr @z_addr to i64) to i32) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %int5 = add i32 %int0, 5 ; CHECK-NEXT: --> (5 + (trunc i64 (ptrtoint ptr @z_addr to i64) to i32)) U: [5,2) S: [-2147483643,-2147483646) ; CHECK-NEXT: %int.zext = zext i32 %int5 to i64 @@ -201,21 +201,21 @@ ; CHECK-NEXT: %tmp = load i32, ptr %tmp_addr, align 4 ; CHECK-NEXT: --> %tmp U: full-set S: full-set ; CHECK-NEXT: %mul = and i32 %tmp, -4 -; CHECK-NEXT: --> (4 * (%tmp /u 4)) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * (%tmp /u 4)) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %add4 = add i32 %mul, 4 -; CHECK-NEXT: --> (4 + (4 * (%tmp /u 4))) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 + (4 * (%tmp /u 4))) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %add4.zext = zext i32 %add4 to i64 ; CHECK-NEXT: --> (zext i32 (4 + (4 * (%tmp /u 4))) to i64) U: [0,4294967293) S: [0,4294967296) ; CHECK-NEXT: %sunkaddr3 = mul i64 %add4.zext, 4 ; CHECK-NEXT: --> (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) U: [0,17179869169) S: [0,17179869181) ; CHECK-NEXT: %sunkaddr4 = getelementptr inbounds i8, ptr @tmp_addr, i64 %sunkaddr3 -; CHECK-NEXT: --> ((4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> ((4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %sunkaddr5 = getelementptr inbounds i8, ptr %sunkaddr4, i64 4096 -; CHECK-NEXT: --> (4096 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> (4096 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %addr4.cast = bitcast ptr %sunkaddr5 to ptr -; CHECK-NEXT: --> (4096 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> (4096 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %addr4.incr = getelementptr i32, ptr %addr4.cast, i64 1 -; CHECK-NEXT: --> (4100 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> (4100 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %add5 = add i32 %mul, 5 ; CHECK-NEXT: --> (5 + (4 * (%tmp /u 4))) U: [5,2) S: [-2147483643,-2147483646) ; CHECK-NEXT: %add5.zext = zext i32 %add5 to i64 @@ -223,11 +223,11 @@ ; CHECK-NEXT: %sunkaddr0 = mul i64 %add5.zext, 4 ; CHECK-NEXT: --> (4 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64))) U: [4,17179869173) S: [4,17179869185) ; CHECK-NEXT: %sunkaddr1 = getelementptr inbounds i8, ptr @tmp_addr, i64 %sunkaddr0 -; CHECK-NEXT: --> (4 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> (4 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %sunkaddr2 = getelementptr inbounds i8, ptr %sunkaddr1, i64 4096 -; CHECK-NEXT: --> (4100 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> (4100 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %addr5.cast = bitcast ptr %sunkaddr2 to ptr -; CHECK-NEXT: --> (4100 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> (4100 + (4 * (zext i32 (4 + (4 * (%tmp /u 4))) to i64)) + @tmp_addr) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: Determining loop execution counts for: @f3 ; entry: diff --git a/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll b/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll --- a/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll +++ b/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll @@ -21,7 +21,7 @@ ; CHECK-NEXT: %stop = load i32, ptr %load.addr, align 4 ; CHECK-NEXT: --> %stop U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %indvars.iv.next = add nsw i64 %indvars.iv, -1 -; CHECK-NEXT: --> {(-1 + (zext i32 %start to i64)),+,-1}<%loop> U: [-4294967296,4294967295) S: [-1,4294967295) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-1 + (zext i32 %start to i64)),+,-1}<%loop> U: [18446744069414584320,4294967295) S: [-1,4294967295) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_01 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: (zext i32 %start to i64) @@ -69,7 +69,7 @@ ; CHECK-NEXT: %shl = shl i64 %zext, 31 ; CHECK-NEXT: --> (2147483648 * (zext i32 %start to i64)) U: [0,9223372034707292161) S: [0,9223372034707292161) ; CHECK-NEXT: %indvars.iv = phi i64 [ %indvars.iv.next, %loop ], [ %shl, %entry ] -; CHECK-NEXT: --> {(2147483648 * (zext i32 %start to i64)),+,-1}<%loop> U: [-9223372036854775808,9223372034707292161) S: [-9223372036854775808,9223372034707292161) Exits: -9223372036854775806 LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(2147483648 * (zext i32 %start to i64)),+,-1}<%loop> U: [9223372036854775808,9223372034707292161) S: [-9223372036854775808,9223372034707292161) Exits: -9223372036854775806 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indvars.iv.next = add nsw i64 %indvars.iv, -1 ; CHECK-NEXT: --> {(-1 + (2147483648 * (zext i32 %start to i64))),+,-1}<%loop> U: full-set S: full-set Exits: -9223372036854775807 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_02 diff --git a/llvm/test/Analysis/ScalarEvolution/nsw-offset-assume.ll b/llvm/test/Analysis/ScalarEvolution/nsw-offset-assume.ll --- a/llvm/test/Analysis/ScalarEvolution/nsw-offset-assume.ll +++ b/llvm/test/Analysis/ScalarEvolution/nsw-offset-assume.ll @@ -14,7 +14,7 @@ ; CHECK-LABEL: 'foo' ; CHECK-NEXT: Classifying expressions for: @foo ; CHECK-NEXT: %n = and i32 %no, -2 -; CHECK-NEXT: --> (2 * (%no /u 2)) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * (%no /u 2)) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %i.01 = phi i32 [ %16, %bb1 ], [ 0, %bb.nph ] ; CHECK-NEXT: --> {0,+,2}<%bb> U: [0,2147483645) S: [0,2147483645) Exits: (2 * ((-1 + (2 * (%no /u 2))) /u 2)) LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %1 = sext i32 %i.01 to i64 diff --git a/llvm/test/Analysis/ScalarEvolution/nsw-offset.ll b/llvm/test/Analysis/ScalarEvolution/nsw-offset.ll --- a/llvm/test/Analysis/ScalarEvolution/nsw-offset.ll +++ b/llvm/test/Analysis/ScalarEvolution/nsw-offset.ll @@ -11,7 +11,7 @@ ; CHECK-LABEL: 'foo' ; CHECK-NEXT: Classifying expressions for: @foo ; CHECK-NEXT: %n = and i32 %no, -2 -; CHECK-NEXT: --> (2 * (%no /u 2)) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * (%no /u 2)) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %i.01 = phi i32 [ %16, %bb1 ], [ 0, %bb.nph ] ; CHECK-NEXT: --> {0,+,2}<%bb> U: [0,2147483645) S: [0,2147483645) Exits: (2 * ((-1 + (2 * (%no /u 2))) /u 2)) LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %1 = sext i32 %i.01 to i64 diff --git a/llvm/test/Analysis/ScalarEvolution/nsw.ll b/llvm/test/Analysis/ScalarEvolution/nsw.ll --- a/llvm/test/Analysis/ScalarEvolution/nsw.ll +++ b/llvm/test/Analysis/ScalarEvolution/nsw.ll @@ -9,21 +9,21 @@ ; CHECK-LABEL: 'test1' ; CHECK-NEXT: Classifying expressions for: @test1 ; CHECK-NEXT: %i.01 = phi i32 [ %tmp8, %bb1 ], [ 0, %bb.nph ] -; CHECK-NEXT: --> {0,+,1}<%bb> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %bb: Computable } +; CHECK-NEXT: --> {0,+,1}<%bb> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %tmp2 = sext i32 %i.01 to i64 -; CHECK-NEXT: --> {0,+,1}<%bb> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb: Computable } +; CHECK-NEXT: --> {0,+,1}<%bb> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %tmp3 = getelementptr double, ptr %p, i64 %tmp2 ; CHECK-NEXT: --> {%p,+,8}<%bb> U: full-set S: full-set Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %tmp6 = sext i32 %i.01 to i64 -; CHECK-NEXT: --> {0,+,1}<%bb> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb: Computable } +; CHECK-NEXT: --> {0,+,1}<%bb> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %tmp7 = getelementptr double, ptr %p, i64 %tmp6 ; CHECK-NEXT: --> {%p,+,8}<%bb> U: full-set S: full-set Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %tmp8 = add nsw i32 %i.01, 1 -; CHECK-NEXT: --> {1,+,1}<%bb> U: [1,-2147483648) S: [1,-2147483648) Exits: <> LoopDispositions: { %bb: Computable } +; CHECK-NEXT: --> {1,+,1}<%bb> U: [1,2147483648) S: [1,-2147483648) Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %p.gep = getelementptr double, ptr %p, i32 %tmp8 ; CHECK-NEXT: --> {(8 + %p),+,8}<%bb> U: full-set S: full-set Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %phitmp = sext i32 %tmp8 to i64 -; CHECK-NEXT: --> {1,+,1}<%bb> U: [1,-9223372036854775808) S: [1,-9223372036854775808) Exits: <> LoopDispositions: { %bb: Computable } +; CHECK-NEXT: --> {1,+,1}<%bb> U: [1,9223372036854775808) S: [1,-9223372036854775808) Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: %tmp9 = getelementptr inbounds double, ptr %p, i64 %phitmp ; CHECK-NEXT: --> {(8 + %p),+,8}<%bb> U: full-set S: full-set Exits: <> LoopDispositions: { %bb: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test1 @@ -174,7 +174,7 @@ ; CHECK-NEXT: %tmp2 = phi ptr [ %arg, %bb ], [ %tmp5, %bb1 ] ; CHECK-NEXT: --> {%arg,+,4}<%bb1> U: full-set S: full-set Exits: (4 + %arg) LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp3 = phi i32 [ 0, %bb ], [ %tmp4, %bb1 ] -; CHECK-NEXT: --> {0,+,1}<%bb1> U: [0,-2147483648) S: [0,-2147483648) Exits: 1 LoopDispositions: { %bb1: Computable } +; CHECK-NEXT: --> {0,+,1}<%bb1> U: [0,2147483648) S: [0,-2147483648) Exits: 1 LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp4 = add nsw i32 %tmp3, 1 ; CHECK-NEXT: --> {1,+,1}<%bb1> U: [1,0) S: [1,0) Exits: 2 LoopDispositions: { %bb1: Computable } ; CHECK-NEXT: %tmp5 = getelementptr inbounds i32, ptr %tmp2, i64 1 @@ -276,15 +276,15 @@ ; CHECK-LABEL: 'test4' ; CHECK-NEXT: Classifying expressions for: @test4 ; CHECK-NEXT: %array = alloca [10 x i32], align 4 -; CHECK-NEXT: --> %array U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> %array U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %index = phi i32 [ %inc5, %for.body ], [ %arg, %entry ] ; CHECK-NEXT: --> {%arg,+,1}<%for.body> U: full-set S: full-set Exits: (-1 + (10 smax (1 + %arg))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %sub = add nsw i32 %index, -2 ; CHECK-NEXT: --> {(-2 + %arg),+,1}<%for.body> U: full-set S: full-set Exits: (-3 + (10 smax (1 + %arg))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %idxprom = sext i32 %sub to i64 -; CHECK-NEXT: --> {(-2 + (sext i32 %arg to i64)),+,1}<%for.body> U: [-2147483650,4294967304) S: [-2147483650,4294967304) Exits: (-2 + (zext i32 (-1 + (-1 * %arg) + (10 smax (1 + %arg))) to i64) + (sext i32 %arg to i64)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {(-2 + (sext i32 %arg to i64)),+,1}<%for.body> U: [18446744071562067966,4294967304) S: [-2147483650,4294967304) Exits: (-2 + (zext i32 (-1 + (-1 * %arg) + (10 smax (1 + %arg))) to i64) + (sext i32 %arg to i64)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %arrayidx = getelementptr inbounds [10 x i32], ptr %array, i64 0, i64 %idxprom -; CHECK-NEXT: --> {(-8 + (4 * (sext i32 %arg to i64)) + %array),+,4}<%for.body> U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: (-8 + (4 * (zext i32 (-1 + (-1 * %arg) + (10 smax (1 + %arg))) to i64)) + (4 * (sext i32 %arg to i64)) + %array) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {(-8 + (4 * (sext i32 %arg to i64)) + %array),+,4}<%for.body> U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: (-8 + (4 * (zext i32 (-1 + (-1 * %arg) + (10 smax (1 + %arg))) to i64)) + (4 * (sext i32 %arg to i64)) + %array) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %data = load i32, ptr %arrayidx, align 4 ; CHECK-NEXT: --> %data U: full-set S: full-set Exits: <> LoopDispositions: { %for.body: Variant } ; CHECK-NEXT: %inc5 = add nsw i32 %index, 1 @@ -320,7 +320,7 @@ ; CHECK-LABEL: 'bad_postinc_nsw_a' ; CHECK-NEXT: Classifying expressions for: @bad_postinc_nsw_a ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] -; CHECK-NEXT: --> {0,+,7}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (7 * ((((-1 * (1 umin %n)) + %n) /u 7) + (1 umin %n))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,7}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (7 * ((((-1 * (1 umin %n)) + %n) /u 7) + (1 umin %n))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 7 ; CHECK-NEXT: --> {7,+,7}<%loop> U: [7,0) S: [7,0) Exits: (7 + (7 * ((((-1 * (1 umin %n)) + %n) /u 7) + (1 umin %n)))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @bad_postinc_nsw_a @@ -350,9 +350,9 @@ ; CHECK-LABEL: 'postinc_poison_prop_through_and' ; CHECK-NEXT: Classifying expressions for: @postinc_poison_prop_through_and ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] -; CHECK-NEXT: --> {0,+,7}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,7}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 7 -; CHECK-NEXT: --> {7,+,7}<%loop> U: [7,-2147483648) S: [7,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {7,+,7}<%loop> U: [7,2147483648) S: [7,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc.and = and i32 %iv.inc, 0 ; CHECK-NEXT: --> 0 U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: Determining loop execution counts for: @postinc_poison_prop_through_and @@ -381,9 +381,9 @@ ; CHECK-LABEL: 'pr28012' ; CHECK-NEXT: Classifying expressions for: @pr28012 ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ] -; CHECK-NEXT: --> {0,+,7}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (7 * ((-1 + (7 umax %n)) /u 7)) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,7}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (7 * ((-1 + (7 umax %n)) /u 7)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc = add nsw i32 %iv, 7 -; CHECK-NEXT: --> {7,+,7}<%loop> U: [7,-3) S: [7,-3) Exits: (7 + (7 * ((-1 + (7 umax %n)) /u 7))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {7,+,7}<%loop> U: [7,4294967293) S: [7,-3) Exits: (7 + (7 * ((-1 + (7 umax %n)) /u 7))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @pr28012 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-1 + (7 umax %n)) /u 7) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 613566755 @@ -410,9 +410,9 @@ ; CHECK-LABEL: 'select_cond_poison_propagation' ; CHECK-NEXT: Classifying expressions for: @select_cond_poison_propagation ; CHECK-NEXT: %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add nsw i32 %iv, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %sel = select i1 %cmp, i32 10, i32 20 ; CHECK-NEXT: --> %sel U: [0,31) S: [0,31) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %cond = call i1 @cond() diff --git a/llvm/test/Analysis/ScalarEvolution/outer_phi.ll b/llvm/test/Analysis/ScalarEvolution/outer_phi.ll --- a/llvm/test/Analysis/ScalarEvolution/outer_phi.ll +++ b/llvm/test/Analysis/ScalarEvolution/outer_phi.ll @@ -7,11 +7,11 @@ ; CHECK-LABEL: 'test_01' ; CHECK-NEXT: Classifying expressions for: @test_01 ; CHECK-NEXT: %outer.iv = phi i32 [ 0, %entry ], [ %iv.next, %outer.backedge ] -; CHECK-NEXT: --> %outer.iv U: [0,-2147483647) S: [0,-2147483647) Exits: <> LoopDispositions: { %outer: Variant, %inner: Invariant } +; CHECK-NEXT: --> %outer.iv U: [0,2147483649) S: [0,-2147483647) Exits: <> LoopDispositions: { %outer: Variant, %inner: Invariant } ; CHECK-NEXT: %iv = phi i32 [ 0, %outer ], [ %iv.next, %inner.backedge ] -; CHECK-NEXT: --> {0,+,1}<%inner> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %inner: Computable, %outer: Variant } +; CHECK-NEXT: --> {0,+,1}<%inner> U: [0,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %inner: Computable, %outer: Variant } ; CHECK-NEXT: %iv.next = add nuw nsw i32 %iv, 1 -; CHECK-NEXT: --> {1,+,1}<%inner> U: [1,-2147483647) S: [1,-2147483647) Exits: <> LoopDispositions: { %inner: Computable, %outer: Variant } +; CHECK-NEXT: --> {1,+,1}<%inner> U: [1,2147483649) S: [1,-2147483647) Exits: <> LoopDispositions: { %inner: Computable, %outer: Variant } ; CHECK-NEXT: %inner.loop.cond = call i1 @cond() ; CHECK-NEXT: --> %inner.loop.cond U: full-set S: full-set Exits: <> LoopDispositions: { %inner: Variant, %outer: Variant } ; CHECK-NEXT: %outer.loop.cond = call i1 @cond() diff --git a/llvm/test/Analysis/ScalarEvolution/pointer-rounding.ll b/llvm/test/Analysis/ScalarEvolution/pointer-rounding.ll --- a/llvm/test/Analysis/ScalarEvolution/pointer-rounding.ll +++ b/llvm/test/Analysis/ScalarEvolution/pointer-rounding.ll @@ -9,7 +9,7 @@ ; CHECK-NEXT: %i2 = and i64 %i, 15 ; CHECK-NEXT: --> (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64) U: [0,16) S: [0,16) ; CHECK-NEXT: %i3 = sub nsw i64 0, %i2 -; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64)) U: [-15,1) S: [-15,1) +; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64)) U: [18446744073709551601,1) S: [-15,1) ; CHECK-NEXT: %i4 = getelementptr i8, ptr %obj, i64 %i3 ; CHECK-NEXT: --> ((-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64)) + %obj) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @pointer_align_down @@ -29,7 +29,7 @@ ; CHECK-NEXT: %i2 = and i64 %i, 15 ; CHECK-NEXT: --> (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64) U: [0,16) S: [0,16) ; CHECK-NEXT: %i3 = sub nsw i64 0, %i2 -; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) U: [-15,1) S: [-15,1) +; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) U: [18446744073709551601,1) S: [-15,1) ; CHECK-NEXT: %i4 = getelementptr i8, ptr %obj_to_align, i64 %i3 ; CHECK-NEXT: --> ((-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) + %obj_to_align) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @pointer_align_down_different_donor @@ -49,7 +49,7 @@ ; CHECK-NEXT: %over_boundary = add i64 %intptr, 15 ; CHECK-NEXT: --> (15 + (ptrtoint ptr %obj to i64)) U: full-set S: full-set ; CHECK-NEXT: %aligned_intptr = and i64 %over_boundary, -16 -; CHECK-NEXT: --> (16 * ((15 + (ptrtoint ptr %obj to i64)) /u 16)) U: [0,-15) S: [-9223372036854775808,9223372036854775793) +; CHECK-NEXT: --> (16 * ((15 + (ptrtoint ptr %obj to i64)) /u 16)) U: [0,18446744073709551601) S: [-9223372036854775808,9223372036854775793) ; CHECK-NEXT: %diff = sub i64 %aligned_intptr, %intptr ; CHECK-NEXT: --> ((16 * ((15 + (ptrtoint ptr %obj to i64)) /u 16)) + (-1 * (ptrtoint ptr %obj to i64))) U: full-set S: full-set ; CHECK-NEXT: %aligned_result = getelementptr i8, ptr %obj, i64 %diff @@ -72,7 +72,7 @@ ; CHECK-NEXT: %over_boundary = add i64 %intptr, 15 ; CHECK-NEXT: --> (15 + (ptrtoint ptr %obj_donor to i64)) U: full-set S: full-set ; CHECK-NEXT: %aligned_intptr = and i64 %over_boundary, -16 -; CHECK-NEXT: --> (16 * ((15 + (ptrtoint ptr %obj_donor to i64)) /u 16)) U: [0,-15) S: [-9223372036854775808,9223372036854775793) +; CHECK-NEXT: --> (16 * ((15 + (ptrtoint ptr %obj_donor to i64)) /u 16)) U: [0,18446744073709551601) S: [-9223372036854775808,9223372036854775793) ; CHECK-NEXT: %diff = sub i64 %aligned_intptr, %intptr ; CHECK-NEXT: --> ((16 * ((15 + (ptrtoint ptr %obj_donor to i64)) /u 16)) + (-1 * (ptrtoint ptr %obj_donor to i64))) U: full-set S: full-set ; CHECK-NEXT: %aligned_result = getelementptr i8, ptr %obj_to_align, i64 %diff @@ -95,7 +95,7 @@ ; CHECK-NEXT: %i2 = and i64 %i, 15 ; CHECK-NEXT: --> (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64) U: [0,16) S: [0,16) ; CHECK-NEXT: %i4 = sub nsw i64 0, %i2 -; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64)) U: [-15,1) S: [-15,1) +; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64)) U: [18446744073709551601,1) S: [-15,1) ; CHECK-NEXT: %i5 = getelementptr i8, ptr %obj, i64 %i4 ; CHECK-NEXT: --> ((-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj to i64) to i4) to i64)) + %obj) U: full-set S: full-set ; CHECK-NEXT: %i6 = getelementptr i8, ptr %i5, i64 16 @@ -122,7 +122,7 @@ ; CHECK-NEXT: %i2 = and i64 %i, 15 ; CHECK-NEXT: --> (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64) U: [0,16) S: [0,16) ; CHECK-NEXT: %i4 = sub nsw i64 0, %i2 -; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) U: [-15,1) S: [-15,1) +; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) U: [18446744073709551601,1) S: [-15,1) ; CHECK-NEXT: %i5 = getelementptr i8, ptr %obj_to_align, i64 %i4 ; CHECK-NEXT: --> ((-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) + %obj_to_align) U: full-set S: full-set ; CHECK-NEXT: %i6 = getelementptr i8, ptr %i5, i64 16 @@ -149,7 +149,7 @@ ; CHECK-NEXT: %i2 = and i64 %i, 15 ; CHECK-NEXT: --> (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64) U: [0,16) S: [0,16) ; CHECK-NEXT: %i4 = sub nsw i64 0, %i2 -; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) U: [-15,1) S: [-15,1) +; CHECK-NEXT: --> (-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) U: [18446744073709551601,1) S: [-15,1) ; CHECK-NEXT: %i5 = getelementptr i8, ptr %second_obj, i64 %i4 ; CHECK-NEXT: --> ((-1 * (zext i4 (trunc i64 (ptrtoint ptr %obj_donor to i64) to i4) to i64)) + %second_obj) U: full-set S: full-set ; CHECK-NEXT: %i6 = getelementptr i8, ptr %i5, i64 16 diff --git a/llvm/test/Analysis/ScalarEvolution/pr49856.ll b/llvm/test/Analysis/ScalarEvolution/pr49856.ll --- a/llvm/test/Analysis/ScalarEvolution/pr49856.ll +++ b/llvm/test/Analysis/ScalarEvolution/pr49856.ll @@ -5,9 +5,9 @@ ; CHECK-LABEL: 'test' ; CHECK-NEXT: Classifying expressions for: @test ; CHECK-NEXT: %tmp = phi i32 [ 2, %bb ], [ %tmp2, %bb3 ] -; CHECK-NEXT: --> %tmp U: [1,-2147483648) S: [0,-2147483648) +; CHECK-NEXT: --> %tmp U: [1,2147483648) S: [0,-2147483648) ; CHECK-NEXT: %tmp2 = add nuw nsw i32 %tmp, 1 -; CHECK-NEXT: --> (1 + %tmp) U: [1,-2147483647) S: [1,-2147483647) +; CHECK-NEXT: --> (1 + %tmp) U: [1,2147483649) S: [1,-2147483647) ; CHECK-NEXT: Determining loop execution counts for: @test ; bb: diff --git a/llvm/test/Analysis/ScalarEvolution/pr58402-large-number-of-zext-exprs.ll b/llvm/test/Analysis/ScalarEvolution/pr58402-large-number-of-zext-exprs.ll --- a/llvm/test/Analysis/ScalarEvolution/pr58402-large-number-of-zext-exprs.ll +++ b/llvm/test/Analysis/ScalarEvolution/pr58402-large-number-of-zext-exprs.ll @@ -9,7 +9,7 @@ ; CHECK-NEXT: %b.0 = phi i32 [ 59, %entry ], [ %b.0, %header ] ; CHECK-NEXT: --> 59 U: [59,60) S: [59,60) Exits: 59 LoopDispositions: { %header: Invariant } ; CHECK-NEXT: %conv.neg = sext i1 %cmp to i32 -; CHECK-NEXT: --> (sext i1 %cmp to i32) U: [-1,1) S: [-1,1) Exits: <> LoopDispositions: { %header: Variant } +; CHECK-NEXT: --> (sext i1 %cmp to i32) U: [4294967295,1) S: [-1,1) Exits: <> LoopDispositions: { %header: Variant } ; CHECK-NEXT: %conv = zext i1 %cmp to i32 ; CHECK-NEXT: --> (zext i1 %cmp to i32) U: [0,2) S: [0,2) Exits: <> LoopDispositions: { %header: Variant } ; CHECK-NEXT: %i = and i32 %conv, -2 diff --git a/llvm/test/Analysis/ScalarEvolution/predicated-trip-count.ll b/llvm/test/Analysis/ScalarEvolution/predicated-trip-count.ll --- a/llvm/test/Analysis/ScalarEvolution/predicated-trip-count.ll +++ b/llvm/test/Analysis/ScalarEvolution/predicated-trip-count.ll @@ -22,13 +22,13 @@ ; CHECK-LABEL: 'test1' ; CHECK-NEXT: Classifying expressions for: @test1 ; CHECK-NEXT: %tmp = getelementptr [1000 x i32], ptr @A, i32 0, i16 %i.0 -; CHECK-NEXT: --> ((4 * (sext i16 {0,+,1}<%bb3> to i64)) + @A) U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %bb3: Computable } +; CHECK-NEXT: --> ((4 * (sext i16 {0,+,1}<%bb3> to i64)) + @A) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: %tmp2 = add i16 %i.0, 1 ; CHECK-NEXT: --> {1,+,1}<%bb3> U: full-set S: full-set Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: %i.0 = phi i16 [ 0, %entry ], [ %tmp2, %bb ] ; CHECK-NEXT: --> {0,+,1}<%bb3> U: full-set S: full-set Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: %i.0.ext = sext i16 %i.0 to i32 -; CHECK-NEXT: --> (sext i16 {0,+,1}<%bb3> to i32) U: [-32768,32768) S: [-32768,32768) Exits: <> LoopDispositions: { %bb3: Computable } +; CHECK-NEXT: --> (sext i16 {0,+,1}<%bb3> to i32) U: [4294934528,32768) S: [-32768,32768) Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test1 ; CHECK-NEXT: Loop %bb3: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %bb3: Unpredictable constant max backedge-taken count. @@ -89,13 +89,13 @@ ; CHECK-LABEL: 'test2' ; CHECK-NEXT: Classifying expressions for: @test2 ; CHECK-NEXT: %tmp = getelementptr [1000 x i32], ptr @A, i32 0, i16 %i.0 -; CHECK-NEXT: --> ((4 * (sext i16 {%Start,+,-1}<%bb3> to i64)) + @A) U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %bb3: Computable } +; CHECK-NEXT: --> ((4 * (sext i16 {%Start,+,-1}<%bb3> to i64)) + @A) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: %tmp2 = sub i16 %i.0, 1 ; CHECK-NEXT: --> {(-1 + %Start),+,-1}<%bb3> U: full-set S: full-set Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: %i.0 = phi i16 [ %Start, %entry ], [ %tmp2, %bb ] ; CHECK-NEXT: --> {%Start,+,-1}<%bb3> U: full-set S: full-set Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: %i.0.ext = sext i16 %i.0 to i32 -; CHECK-NEXT: --> (sext i16 {%Start,+,-1}<%bb3> to i32) U: [-32768,32768) S: [-32768,32768) Exits: <> LoopDispositions: { %bb3: Computable } +; CHECK-NEXT: --> (sext i16 {%Start,+,-1}<%bb3> to i32) U: [4294934528,32768) S: [-32768,32768) Exits: <> LoopDispositions: { %bb3: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test2 ; CHECK-NEXT: Loop %bb3: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %bb3: Unpredictable constant max backedge-taken count. diff --git a/llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll b/llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll --- a/llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll +++ b/llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll @@ -12,7 +12,7 @@ ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i64' ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i64 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64) ; PTR64_IDX64-NEXT: --> ((ptrtoint ptr @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i64) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -20,7 +20,7 @@ ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -30,7 +30,7 @@ ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i64' ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i64 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64) ; PTR64_IDX32-NEXT: --> ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -38,7 +38,7 @@ ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -48,7 +48,7 @@ ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i64' ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i64 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64) ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -56,7 +56,7 @@ ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -66,7 +66,7 @@ ; PTR16_IDX32-LABEL: 'trunc_ptr_to_i64' ; PTR16_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i64 ; PTR16_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR16_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64) ; PTR16_IDX32-NEXT: --> ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) U: [0,131071) S: [0,131071) Exits: ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR16_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -74,7 +74,7 @@ ; PTR16_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR16_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR16_IDX32-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR16_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64 ; PTR16_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR16_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -103,7 +103,7 @@ ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i32' ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i32 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32) ; PTR64_IDX64-NEXT: --> ((sext i32 (trunc i64 (ptrtoint ptr @global to i64) to i32) to i64) + %arg) U: full-set S: full-set Exits: ((sext i32 (trunc i64 (ptrtoint ptr @global to i64) to i32) to i64) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -111,7 +111,7 @@ ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -121,7 +121,7 @@ ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i32' ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i32 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32) ; PTR64_IDX32-NEXT: --> (ptrtoint (ptr @global to i32) + %arg) U: full-set S: full-set Exits: (ptrtoint (ptr @global to i32) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -129,7 +129,7 @@ ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -139,7 +139,7 @@ ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i32' ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i32 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32) ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -147,7 +147,7 @@ ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -157,7 +157,7 @@ ; PTR16_IDX32-LABEL: 'trunc_ptr_to_i32' ; PTR16_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i32 ; PTR16_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR16_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32) ; PTR16_IDX32-NEXT: --> (ptrtoint (ptr @global to i32) + %arg) U: [0,131071) S: [0,131071) Exits: (ptrtoint (ptr @global to i32) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR16_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -165,7 +165,7 @@ ; PTR16_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR16_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR16_IDX32-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR16_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32 ; PTR16_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR16_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -194,7 +194,7 @@ ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i128' ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i128 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128) ; PTR64_IDX64-NEXT: --> ((ptrtoint ptr @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i64) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -202,7 +202,7 @@ ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -212,7 +212,7 @@ ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i128' ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i128 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128) ; PTR64_IDX32-NEXT: --> ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -220,7 +220,7 @@ ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -230,7 +230,7 @@ ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i128' ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i128 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128) ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -238,7 +238,7 @@ ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -248,7 +248,7 @@ ; PTR16_IDX32-LABEL: 'trunc_ptr_to_i128' ; PTR16_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i128 ; PTR16_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ] -; PTR16_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128) ; PTR16_IDX32-NEXT: --> ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) U: [0,131071) S: [0,131071) Exits: ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant } ; PTR16_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr @@ -256,7 +256,7 @@ ; PTR16_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4 ; PTR16_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <> LoopDispositions: { %bb11: Variant } ; PTR16_IDX32-NEXT: %tmp18 = add i32 %tmp, 2 -; PTR16_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } +; PTR16_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,4294967295) S: [-2147483648,2147483647) Exits: <> LoopDispositions: { %bb11: Computable } ; PTR16_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128 ; PTR16_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count. ; PTR16_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count. @@ -412,7 +412,7 @@ ; PTR64_IDX64-LABEL: 'sext_like_noop' ; PTR64_IDX64-NEXT: Classifying expressions for: @sext_like_noop ; 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: --> (sext i32 {1,+,1}<%for.body> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32)) to i64) U: [18446744071562067968,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: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] @@ -430,7 +430,7 @@ ; PTR64_IDX32-LABEL: 'sext_like_noop' ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_like_noop ; 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: --> (sext i32 {1,+,1}<%for.body> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + ptrtoint (ptr @sext_like_noop to i32)) to i64) U: [18446744071562067968,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: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] @@ -448,7 +448,7 @@ ; PTR16_IDX16-LABEL: 'sext_like_noop' ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_like_noop ; 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: --> (sext i32 {1,+,1}<%for.body> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i64)) U: [18446744073709551615,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: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] @@ -466,7 +466,7 @@ ; PTR16_IDX32-LABEL: 'sext_like_noop' ; PTR16_IDX32-NEXT: Classifying expressions for: @sext_like_noop ; 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: --> (sext i32 {1,+,1}<%for.body> to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i32 ptrtoint (ptr @sext_like_noop to i32) to i64)) U: [18446744073709551615,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: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ] diff --git a/llvm/test/Analysis/ScalarEvolution/ptrtoint.ll b/llvm/test/Analysis/ScalarEvolution/ptrtoint.ll --- a/llvm/test/Analysis/ScalarEvolution/ptrtoint.ll +++ b/llvm/test/Analysis/ScalarEvolution/ptrtoint.ll @@ -220,7 +220,7 @@ ; X64-NEXT: %i3 = zext i32 %count to i64 ; X64-NEXT: --> (zext i32 %count to i64) U: [0,4294967296) S: [0,4294967296) ; X64-NEXT: %i6 = phi i64 [ 0, %entry ], [ %i9, %loop ] -; X64-NEXT: --> {0,+,1}<%loop> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + (zext i32 %count to i64)) LoopDispositions: { %loop: Computable } +; X64-NEXT: --> {0,+,1}<%loop> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + (zext i32 %count to i64)) LoopDispositions: { %loop: Computable } ; X64-NEXT: %i7 = getelementptr inbounds i32, ptr %in, i64 %i6 ; X64-NEXT: --> {%in,+,4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * (zext i32 %count to i64)) + %in) LoopDispositions: { %loop: Computable } ; X64-NEXT: %i8 = ptrtoint ptr %i7 to i64 @@ -240,7 +240,7 @@ ; X32-NEXT: %i3 = zext i32 %count to i64 ; X32-NEXT: --> (zext i32 %count to i64) U: [0,4294967296) S: [0,4294967296) ; X32-NEXT: %i6 = phi i64 [ 0, %entry ], [ %i9, %loop ] -; X32-NEXT: --> {0,+,1}<%loop> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + (zext i32 %count to i64)) LoopDispositions: { %loop: Computable } +; X32-NEXT: --> {0,+,1}<%loop> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + (zext i32 %count to i64)) LoopDispositions: { %loop: Computable } ; X32-NEXT: %i7 = getelementptr inbounds i32, ptr %in, i64 %i6 ; X32-NEXT: --> {%in,+,4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * %count) + %in) LoopDispositions: { %loop: Computable } ; X32-NEXT: %i8 = ptrtoint ptr %i7 to i64 @@ -473,9 +473,9 @@ ; X64-NEXT: %i9 = ptrtoint ptr %i7 to i64 ; X64-NEXT: --> {(ptrtoint ptr %arg to i64),+,4}<%bb6> U: full-set S: full-set Exits: ((4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4)) + (ptrtoint ptr %arg to i64)) LoopDispositions: { %bb6: Computable } ; X64-NEXT: %i10 = sub i64 %i9, %i4 -; X64-NEXT: --> {0,+,4}<%bb6> U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4)) LoopDispositions: { %bb6: Computable } +; X64-NEXT: --> {0,+,4}<%bb6> U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4)) LoopDispositions: { %bb6: Computable } ; X64-NEXT: %i11 = ashr exact i64 %i10, 2 -; X64-NEXT: --> %i11 U: [-2305843009213693952,2305843009213693952) S: [-2305843009213693952,2305843009213693952) Exits: <> LoopDispositions: { %bb6: Variant } +; X64-NEXT: --> %i11 U: [16140901064495857664,2305843009213693952) S: [-2305843009213693952,2305843009213693952) Exits: <> LoopDispositions: { %bb6: Variant } ; X64-NEXT: %i12 = getelementptr inbounds i32, ptr %arg2, i64 %i11 ; X64-NEXT: --> ((4 * %i11) + %arg2) U: full-set S: full-set Exits: <> LoopDispositions: { %bb6: Variant } ; X64-NEXT: %i13 = load i32, ptr %i12, align 4 @@ -505,7 +505,7 @@ ; X32-NEXT: %i10 = sub i64 %i9, %i4 ; X32-NEXT: --> {0,+,4}<%bb6> U: [0,4294967293) S: [0,4294967293) Exits: (4 * ((zext i32 (-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) to i64) /u 4)) LoopDispositions: { %bb6: Computable } ; X32-NEXT: %i11 = ashr exact i64 %i10, 2 -; X32-NEXT: --> %i11 U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %bb6: Variant } +; X32-NEXT: --> %i11 U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %bb6: Variant } ; X32-NEXT: %i12 = getelementptr inbounds i32, ptr %arg2, i64 %i11 ; X32-NEXT: --> ((4 * (trunc i64 %i11 to i32)) + %arg2) U: full-set S: full-set Exits: <> LoopDispositions: { %bb6: Variant } ; X32-NEXT: %i13 = load i32, ptr %i12, align 4 diff --git a/llvm/test/Analysis/ScalarEvolution/range-signedness.ll b/llvm/test/Analysis/ScalarEvolution/range-signedness.ll --- a/llvm/test/Analysis/ScalarEvolution/range-signedness.ll +++ b/llvm/test/Analysis/ScalarEvolution/range-signedness.ll @@ -5,7 +5,7 @@ ; CHECK-LABEL: 'x' ; CHECK-NEXT: Classifying expressions for: @x ; CHECK-NEXT: %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-128) S: [0,-128) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,128) S: [0,-128) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %idx.inc = add nsw i8 %idx, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %c = load volatile i1, ptr %cond, align 1 @@ -35,9 +35,9 @@ ; CHECK-LABEL: 'y' ; CHECK-NEXT: Classifying expressions for: @y ; CHECK-NEXT: %idx = phi i8 [ -5, %entry ], [ %idx.inc, %loop ] -; CHECK-NEXT: --> {-5,+,1}<%loop> U: [-5,6) S: [-5,6) Exits: 5 LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-5,+,1}<%loop> U: [251,6) S: [-5,6) Exits: 5 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %idx.inc = add i8 %idx, 1 -; CHECK-NEXT: --> {-4,+,1}<%loop> U: [-4,7) S: [-4,7) Exits: 6 LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-4,+,1}<%loop> U: [252,7) S: [-4,7) Exits: 6 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @y ; CHECK-NEXT: Loop %loop: backedge-taken count is 10 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 10 diff --git a/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll b/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll --- a/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll +++ b/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll @@ -40,7 +40,7 @@ ; CHECK-LABEL: 'test-addrec-nuw' ; CHECK-NEXT: Classifying expressions for: @test-addrec-nuw ; CHECK-NEXT: %min.10 = select i1 %cmp, i32 %offset, i32 10 -; CHECK-NEXT: --> (10 smax %offset) U: [10,-2147483648) S: [10,-2147483648) +; CHECK-NEXT: --> (10 smax %offset) U: [10,2147483648) S: [10,-2147483648) ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 @@ -78,13 +78,13 @@ ; CHECK-LABEL: 'test-addrec-nsw-start-neg-strip-neg' ; CHECK-NEXT: Classifying expressions for: @test-addrec-nsw-start-neg-strip-neg ; CHECK-NEXT: %max = select i1 %cmp, i32 %offset, i32 -10 -; CHECK-NEXT: --> (-10 smin %offset) U: [-2147483648,-9) S: [-2147483648,-9) +; CHECK-NEXT: --> (-10 smin %offset) U: [2147483648,4294967287) S: [-2147483648,-9) ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,-1}<%loop> U: [-2147483648,1) S: [-2147483648,1) Exits: (1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,-1}<%loop> U: [2147483648,1) S: [-2147483648,1) Exits: (1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, -1 -; CHECK-NEXT: --> {-1,+,-1}<%loop> U: [-2147483648,0) S: [-2147483648,0) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-1,+,-1}<%loop> U: [2147483648,0) S: [-2147483648,0) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %nexti, %max -; CHECK-NEXT: --> {(-1 + (-10 smin %offset)),+,-1}<%loop> U: [-2147483648,-10) S: [-2147483648,-10) Exits: ((-10 smin %offset) + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-1 + (-10 smin %offset)),+,-1}<%loop> U: [2147483648,4294967286) S: [-2147483648,-10) Exits: ((-10 smin %offset) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(-4 + (4 * (sext i32 (-10 smin %offset) to i64)) + %input),+,-4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * (sext i32 (-10 smin %offset) to i64)) + (-4 * (zext i32 (-1 + (-1 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-addrec-nsw-start-neg-strip-neg @@ -116,13 +116,13 @@ ; CHECK-LABEL: 'test-addrec-nsw-start-pos-strip-neg' ; CHECK-NEXT: Classifying expressions for: @test-addrec-nsw-start-pos-strip-neg ; CHECK-NEXT: %max = select i1 %cmp, i32 %offset, i32 10 -; CHECK-NEXT: --> (10 smin %offset) U: [-2147483648,11) S: [-2147483648,11) +; CHECK-NEXT: --> (10 smin %offset) U: [2147483648,11) S: [-2147483648,11) ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,-1}<%loop> U: [-2147483648,1) S: [-2147483648,1) Exits: (1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,-1}<%loop> U: [2147483648,1) S: [-2147483648,1) Exits: (1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, -1 -; CHECK-NEXT: --> {-1,+,-1}<%loop> U: [-2147483648,0) S: [-2147483648,0) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-1,+,-1}<%loop> U: [2147483648,0) S: [-2147483648,0) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %nexti, %max -; CHECK-NEXT: --> {(-1 + (10 smin %offset)),+,-1}<%loop> U: [-2147483648,10) S: [-2147483648,10) Exits: ((10 smin %offset) + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(-1 + (10 smin %offset)),+,-1}<%loop> U: [2147483648,10) S: [-2147483648,10) Exits: ((10 smin %offset) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(-4 + (4 * (sext i32 (10 smin %offset) to i64)) + %input),+,-4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * (sext i32 (10 smin %offset) to i64)) + (-4 * (zext i32 (-1 + (-1 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-addrec-nsw-start-pos-strip-neg @@ -154,13 +154,13 @@ ; CHECK-LABEL: 'test-addrec-nsw-start-pos-strip-pos' ; CHECK-NEXT: Classifying expressions for: @test-addrec-nsw-start-pos-strip-pos ; CHECK-NEXT: %min = select i1 %cmp, i32 %offset, i32 10 -; CHECK-NEXT: --> (10 smax %offset) U: [10,-2147483648) S: [10,-2147483648) +; CHECK-NEXT: --> (10 smax %offset) U: [10,2147483648) S: [10,-2147483648) ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %nexti, %min -; CHECK-NEXT: --> {(1 + (10 smax %offset)),+,1}<%loop> U: [11,-2147483648) S: [11,-2147483648) Exits: ((10 smax %offset) + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(1 + (10 smax %offset)),+,1}<%loop> U: [11,2147483648) S: [11,-2147483648) Exits: ((10 smax %offset) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(4 + (4 * (zext i32 (10 smax %offset) to i64)) + %input),+,4}<%loop> U: [44,0) S: [44,0) Exits: (4 + (4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (zext i32 (10 smax %offset) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-addrec-nsw-start-pos-strip-pos @@ -192,13 +192,13 @@ ; CHECK-LABEL: 'test-addrec-nsw-start-neg-strip-pos' ; CHECK-NEXT: Classifying expressions for: @test-addrec-nsw-start-neg-strip-pos ; CHECK-NEXT: %min = select i1 %cmp, i32 %offset, i32 -10 -; CHECK-NEXT: --> (-10 smax %offset) U: [-10,-2147483648) S: [-10,-2147483648) +; CHECK-NEXT: --> (-10 smax %offset) U: [4294967286,2147483648) S: [-10,-2147483648) ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %nexti, %min -; CHECK-NEXT: --> {(1 + (-10 smax %offset)),+,1}<%loop> U: [-9,-2147483648) S: [-9,-2147483648) Exits: ((-10 smax %offset) + %numIterations) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(1 + (-10 smax %offset)),+,1}<%loop> U: [4294967287,2147483648) S: [-9,-2147483648) Exits: ((-10 smax %offset) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(4 + (4 * (sext i32 (-10 smax %offset) to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: (4 + (4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 (-10 smax %offset) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-addrec-nsw-start-neg-strip-pos diff --git a/llvm/test/Analysis/ScalarEvolution/ranges.ll b/llvm/test/Analysis/ScalarEvolution/ranges.ll --- a/llvm/test/Analysis/ScalarEvolution/ranges.ll +++ b/llvm/test/Analysis/ScalarEvolution/ranges.ll @@ -29,7 +29,7 @@ ; CHECK-LABEL: 'ashr_global' ; CHECK-NEXT: Classifying expressions for: @ashr_global ; CHECK-NEXT: %ashr = ashr i64 ptrtoint (ptr @G to i64), 63 -; CHECK-NEXT: --> %ashr U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> %ashr U: [18446744073709551615,1) S: [-1,1) ; CHECK-NEXT: Determining loop execution counts for: @ashr_global ; %ashr = ashr i64 ptrtoint (ptr @G to i64), 63 @@ -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,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: Determining loop execution counts for: @shl ; %res = shl i32 %a, 2 @@ -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: --> (sext i8 %a to i64) U: [18446744073709551488,128) S: [-128,128) ; CHECK-NEXT: Determining loop execution counts for: @sext ; %res = sext i8 %a to i64 diff --git a/llvm/test/Analysis/ScalarEvolution/scalable-vector.ll b/llvm/test/Analysis/ScalarEvolution/scalable-vector.ll --- a/llvm/test/Analysis/ScalarEvolution/scalable-vector.ll +++ b/llvm/test/Analysis/ScalarEvolution/scalable-vector.ll @@ -5,7 +5,7 @@ ; CHECK-LABEL: 'a' ; CHECK-NEXT: Classifying expressions for: @a ; CHECK-NEXT: %1 = getelementptr , ptr null, i32 3 -; CHECK-NEXT: --> ((3 * sizeof()) + null) U: [0,-15) S: [-9223372036854775808,9223372036854775793) +; CHECK-NEXT: --> ((3 * sizeof()) + null) U: [0,18446744073709551601) S: [-9223372036854775808,9223372036854775793) ; CHECK-NEXT: %2 = getelementptr , ptr %p, i32 1 ; CHECK-NEXT: --> (sizeof() + %p) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @a diff --git a/llvm/test/Analysis/ScalarEvolution/sdiv.ll b/llvm/test/Analysis/ScalarEvolution/sdiv.ll --- a/llvm/test/Analysis/ScalarEvolution/sdiv.ll +++ b/llvm/test/Analysis/ScalarEvolution/sdiv.ll @@ -8,17 +8,17 @@ ; CHECK-LABEL: '_Z4loopi' ; CHECK-NEXT: Classifying expressions for: @_Z4loopi ; CHECK-NEXT: %storage = alloca [2 x i32], align 4 -; CHECK-NEXT: --> %storage U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> %storage U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %0 = bitcast ptr %storage to ptr -; CHECK-NEXT: --> %storage U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> %storage U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.cond> U: [0,-2147483648) S: [0,-2147483648) Exits: %width LoopDispositions: { %for.cond: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.cond> U: [0,2147483648) S: [0,-2147483648) Exits: %width LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %rem = sdiv i32 %i.0, 2 ; CHECK-NEXT: --> ({0,+,1}<%for.cond> /u 2) U: [0,1073741824) S: [0,1073741824) Exits: (%width /u 2) LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %idxprom = sext i32 %rem to i64 ; CHECK-NEXT: --> ({0,+,1}<%for.cond> /u 2) U: [0,2147483648) S: [0,2147483648) Exits: ((zext i32 %width to i64) /u 2) LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %arrayidx = getelementptr inbounds [2 x i32], ptr %storage, i64 0, i64 %idxprom -; CHECK-NEXT: --> ((4 * ({0,+,1}<%for.cond> /u 2)) + %storage) U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: ((4 * ((zext i32 %width to i64) /u 2)) + %storage) LoopDispositions: { %for.cond: Computable } +; CHECK-NEXT: --> ((4 * ({0,+,1}<%for.cond> /u 2)) + %storage) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: ((4 * ((zext i32 %width to i64) /u 2)) + %storage) LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %1 = load i32, ptr %arrayidx, align 4 ; CHECK-NEXT: --> %1 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %call = call i32 @_Z3adji(i32 %1) diff --git a/llvm/test/Analysis/ScalarEvolution/sext-mul.ll b/llvm/test/Analysis/ScalarEvolution/sext-mul.ll --- a/llvm/test/Analysis/ScalarEvolution/sext-mul.ll +++ b/llvm/test/Analysis/ScalarEvolution/sext-mul.ll @@ -9,9 +9,9 @@ ; CHECK-NEXT: %tmp8 = phi i64 [ %tmp18, %bb7 ], [ 0, %bb3 ] ; CHECK-NEXT: --> {0,+,1}<%bb7> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + (zext i32 %arg2 to i64)) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %tmp9 = shl i64 %tmp8, 33 -; CHECK-NEXT: --> {0,+,8589934592}<%bb7> U: [0,-17179869183) S: [-9223372036854775808,9223372028264841217) Exits: (-8589934592 + (8589934592 * (zext i32 %arg2 to i64))) LoopDispositions: { %bb7: Computable } +; CHECK-NEXT: --> {0,+,8589934592}<%bb7> U: [0,18446744056529682433) S: [-9223372036854775808,9223372028264841217) Exits: (-8589934592 + (8589934592 * (zext i32 %arg2 to i64))) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %tmp10 = ashr exact i64 %tmp9, 32 -; CHECK-NEXT: --> (sext i32 {0,+,2}<%bb7> to i64) U: [0,-1) S: [-2147483648,2147483647) Exits: (sext i32 (-2 + (2 * %arg2)) to i64) LoopDispositions: { %bb7: Computable } +; CHECK-NEXT: --> (sext i32 {0,+,2}<%bb7> to i64) U: [0,18446744073709551615) S: [-2147483648,2147483647) Exits: (sext i32 (-2 + (2 * %arg2)) to i64) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %tmp11 = getelementptr inbounds i32, ptr %arg, i64 %tmp10 ; CHECK-NEXT: --> ((4 * (sext i32 {0,+,2}<%bb7> to i64)) + %arg) U: full-set S: full-set Exits: ((4 * (sext i32 (-2 + (2 * %arg2)) to i64)) + %arg) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %tmp12 = load i32, ptr %tmp11, align 4 @@ -76,9 +76,9 @@ ; CHECK-NEXT: %t8 = phi i128 [ %t18, %bb7 ], [ 0, %bb3 ] ; CHECK-NEXT: --> {0,+,1}<%bb7> U: [0,2147483647) S: [0,2147483647) Exits: (-1 + (zext i32 %arg5 to i128)) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %t9 = shl i128 %t8, 100 -; CHECK-NEXT: --> {0,+,1267650600228229401496703205376}<%bb7> U: [0,-1267650600228229401496703205375) S: [-170141183460469231731687303715884105728,170141182192818631503457902219180900353) Exits: (-1267650600228229401496703205376 + (1267650600228229401496703205376 * (zext i32 %arg5 to i128))) LoopDispositions: { %bb7: Computable } +; CHECK-NEXT: --> {0,+,1267650600228229401496703205376}<%bb7> U: [0,340282365653287863235145205935065006081) S: [-170141183460469231731687303715884105728,170141182192818631503457902219180900353) Exits: (-1267650600228229401496703205376 + (1267650600228229401496703205376 * (zext i32 %arg5 to i128))) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %t10 = ashr exact i128 %t9, 1 -; CHECK-NEXT: --> (sext i127 {0,+,633825300114114700748351602688}<%bb7> to i128) U: [0,-633825300114114700748351602687) S: [-85070591730234615865843651857942052864,85070591096409315751728951109590450177) Exits: (sext i127 (-633825300114114700748351602688 + (633825300114114700748351602688 * (zext i32 %arg5 to i127))) to i128) LoopDispositions: { %bb7: Computable } +; CHECK-NEXT: --> (sext i127 {0,+,633825300114114700748351602688}<%bb7> to i128) U: [0,340282366287113163349259906683416608769) S: [-85070591730234615865843651857942052864,85070591096409315751728951109590450177) Exits: (sext i127 (-633825300114114700748351602688 + (633825300114114700748351602688 * (zext i32 %arg5 to i127))) to i128) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %t11 = getelementptr inbounds i32, ptr %arg3, i128 %t10 ; CHECK-NEXT: --> %arg3 U: full-set S: full-set Exits: %arg3 LoopDispositions: { %bb7: Invariant } ; CHECK-NEXT: %t12 = load i32, ptr %t11, align 4 @@ -86,7 +86,7 @@ ; CHECK-NEXT: %t13 = sub nsw i32 %t12, %arg4 ; CHECK-NEXT: --> ((-1 * %arg4) + %t12) U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %t14 = or i128 %t10, 1 -; CHECK-NEXT: --> (1 + (sext i127 {0,+,633825300114114700748351602688}<%bb7> to i128)) U: [1,-633825300114114700748351602686) S: [-85070591730234615865843651857942052863,85070591096409315751728951109590450178) Exits: (1 + (sext i127 (-633825300114114700748351602688 + (633825300114114700748351602688 * (zext i32 %arg5 to i127))) to i128)) LoopDispositions: { %bb7: Computable } +; CHECK-NEXT: --> (1 + (sext i127 {0,+,633825300114114700748351602688}<%bb7> to i128)) U: [1,340282366287113163349259906683416608770) S: [-85070591730234615865843651857942052863,85070591096409315751728951109590450178) Exits: (1 + (sext i127 (-633825300114114700748351602688 + (633825300114114700748351602688 * (zext i32 %arg5 to i127))) to i128)) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %t15 = getelementptr inbounds i32, ptr %arg3, i128 %t14 ; CHECK-NEXT: --> (4 + %arg3) U: [4,0) S: [4,0) Exits: (4 + %arg3) LoopDispositions: { %bb7: Invariant } ; CHECK-NEXT: %t16 = load i32, ptr %t15, align 4 diff --git a/llvm/test/Analysis/ScalarEvolution/sext-to-zext.ll b/llvm/test/Analysis/ScalarEvolution/sext-to-zext.ll --- a/llvm/test/Analysis/ScalarEvolution/sext-to-zext.ll +++ b/llvm/test/Analysis/ScalarEvolution/sext-to-zext.ll @@ -15,7 +15,7 @@ ; CHECK-NEXT: %iv.tc.inc = add i32 %iv.tc, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,101) S: [1,101) Exits: 100 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.dec = add nsw i32 %iv, %step -; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-200,201) S: [-200,201) Exits: ((100 * %step) + %start) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [4294967096,201) S: [-200,201) Exits: ((100 * %step) + %start) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.sext = sext i32 %iv to i64 ; CHECK-NEXT: --> {(zext i32 %start to i64),+,(sext i32 %step to i64)}<%loop> U: [0,101) S: [0,101) Exits: ((zext i32 %start to i64) + (99 * (sext i32 %step to i64))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @f diff --git a/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll b/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll --- a/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll +++ b/llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll @@ -76,9 +76,9 @@ ; CHECK-LABEL: 'test_ashr_ones' ; CHECK-NEXT: Classifying expressions for: @test_ashr_ones ; CHECK-NEXT: %iv.ashr = phi i64 [ -1023, %entry ], [ %iv.ashr.next, %loop ] -; CHECK-NEXT: --> %iv.ashr U: [-1023,0) S: [-1023,0) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr U: [18446744073709550593,0) S: [-1023,0) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.ashr.next = ashr i64 %iv.ashr, 1 -; CHECK-NEXT: --> %iv.ashr.next U: [-512,0) S: [-512,0) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr.next U: [18446744073709551104,0) S: [-512,0) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_ashr_ones ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. @@ -100,9 +100,9 @@ ; CHECK-LABEL: 'test_ashr_ones2' ; CHECK-NEXT: Classifying expressions for: @test_ashr_ones2 ; CHECK-NEXT: %iv.ashr = phi i64 [ %iv.ashr.next, %loop ], [ -1023, %entry ] -; CHECK-NEXT: --> %iv.ashr U: [-1023,0) S: [-1023,0) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr U: [18446744073709550593,0) S: [-1023,0) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.ashr.next = ashr i64 %iv.ashr, 1 -; CHECK-NEXT: --> %iv.ashr.next U: [-512,0) S: [-512,0) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr.next U: [18446744073709551104,0) S: [-512,0) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_ashr_ones2 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. @@ -127,7 +127,7 @@ ; CHECK-NEXT: %iv.ashr = phi i64 [ %start, %entry ], [ %iv.ashr.next, %loop ] ; CHECK-NEXT: --> %iv.ashr U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.ashr.next = ashr i64 %iv.ashr, 1 -; CHECK-NEXT: --> %iv.ashr.next U: [-4611686018427387904,4611686018427387904) S: [-4611686018427387904,4611686018427387904) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr.next U: [13835058055282163712,4611686018427387904) S: [-4611686018427387904,4611686018427387904) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_ashr_unknown ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. @@ -152,7 +152,7 @@ ; CHECK-NEXT: %iv.ashr = phi i64 [ %start, %entry ], [ %iv.ashr.next, %loop ] ; CHECK-NEXT: --> %iv.ashr U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.ashr.next = ashr i64 1, %iv.ashr -; CHECK-NEXT: --> %iv.ashr.next U: [-2,2) S: [-2,2) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr.next U: [18446744073709551614,2) S: [-2,2) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_ashr_wrong_op ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. @@ -174,9 +174,9 @@ ; CHECK-LABEL: 'test_shl' ; CHECK-NEXT: Classifying expressions for: @test_shl ; CHECK-NEXT: %iv.shl = phi i64 [ 8, %entry ], [ %iv.shl.next, %loop ] -; CHECK-NEXT: --> %iv.shl U: [0,-7) S: [-9223372036854775808,9223372036854775793) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.shl U: [0,18446744073709551609) S: [-9223372036854775808,9223372036854775793) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.shl.next = shl i64 %iv.shl, 1 -; CHECK-NEXT: --> (2 * %iv.shl) U: [0,-15) S: [-9223372036854775808,9223372036854775793) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (2 * %iv.shl) U: [0,18446744073709551601) S: [-9223372036854775808,9223372036854775793) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_shl ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. @@ -239,7 +239,7 @@ ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,6) S: [1,6) Exits: 5 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl.next = shl i64 %iv.shl, %shiftamt -; CHECK-NEXT: --> %iv.shl.next U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.shl.next U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_shl3 ; CHECK-NEXT: Loop %loop: backedge-taken count is 4 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4 @@ -273,7 +273,7 @@ ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,62) S: [1,62) Exits: 61 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl.next = shl i64 %iv.shl, 1 -; CHECK-NEXT: --> (2 * %iv.shl) U: [8,-9223372036854775807) S: [-9223372036854775808,9223372036854775801) Exits: -9223372036854775808 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (2 * %iv.shl) U: [8,9223372036854775809) S: [-9223372036854775808,9223372036854775801) Exits: -9223372036854775808 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_shl4 ; CHECK-NEXT: Loop %loop: backedge-taken count is 60 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 60 @@ -302,11 +302,11 @@ ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,62) S: [0,62) Exits: 61 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl = phi i64 [ 4, %entry ], [ %iv.shl.next, %loop ] -; CHECK-NEXT: --> %iv.shl U: [0,-3) S: [-9223372036854775808,9223372036854775801) Exits: -9223372036854775808 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.shl U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775801) Exits: -9223372036854775808 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,63) S: [1,63) Exits: 62 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl.next = shl i64 %iv.shl, 1 -; CHECK-NEXT: --> (2 * %iv.shl) U: [0,-7) S: [-9223372036854775808,9223372036854775801) Exits: 0 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (2 * %iv.shl) U: [0,18446744073709551609) S: [-9223372036854775808,9223372036854775801) Exits: 0 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_shl5 ; CHECK-NEXT: Loop %loop: backedge-taken count is 61 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 61 @@ -341,7 +341,7 @@ ; CHECK-NEXT: %shiftamt = and i64 %iv, 1 ; CHECK-NEXT: --> (zext i1 {false,+,true}<%loop> to i64) U: [0,2) S: [0,2) Exits: 0 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl.next = shl i64 %iv.shl, %shiftamt -; CHECK-NEXT: --> %iv.shl.next U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: 16 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.shl.next U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: 16 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_shl6 ; CHECK-NEXT: Loop %loop: backedge-taken count is 4 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4 @@ -371,7 +371,7 @@ ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,5) S: [0,5) Exits: 4 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl = phi i64 [ 4, %entry ], [ %iv.shl.next, %loop ] -; CHECK-NEXT: --> %iv.shl U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.shl U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,6) S: [1,6) Exits: 5 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.shl.next = shl i64 %iv.shl, %shiftamt @@ -461,9 +461,9 @@ ; CHECK-LABEL: 'nonloop_recurrence' ; CHECK-NEXT: Classifying expressions for: @nonloop_recurrence ; CHECK-NEXT: %tmp = phi i32 [ 2, %bb ], [ %tmp2, %bb3 ] -; CHECK-NEXT: --> %tmp U: [1,-2147483648) S: [0,-2147483648) +; CHECK-NEXT: --> %tmp U: [1,2147483648) S: [0,-2147483648) ; CHECK-NEXT: %tmp2 = add nuw nsw i32 %tmp, 1 -; CHECK-NEXT: --> (1 + %tmp) U: [1,-2147483647) S: [1,-2147483647) +; CHECK-NEXT: --> (1 + %tmp) U: [1,2147483649) S: [1,-2147483647) ; CHECK-NEXT: Determining loop execution counts for: @nonloop_recurrence ; bb: @@ -485,9 +485,9 @@ ; CHECK-LABEL: 'nonloop_recurrence_2' ; CHECK-NEXT: Classifying expressions for: @nonloop_recurrence_2 ; CHECK-NEXT: %tmp = phi i32 [ 2, %loop ], [ %tmp2, %bb3 ] -; CHECK-NEXT: --> %tmp U: [1,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %tmp U: [1,2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %tmp2 = add nuw nsw i32 %tmp, 1 -; CHECK-NEXT: --> (1 + %tmp) U: [1,-2147483647) S: [1,-2147483647) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (1 + %tmp) U: [1,2147483649) S: [1,-2147483647) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @nonloop_recurrence_2 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count. @@ -550,11 +550,11 @@ ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,5) S: [0,5) Exits: 4 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.ashr = phi i8 [ -128, %entry ], [ %iv.ashr.next, %loop ] -; CHECK-NEXT: --> %iv.ashr U: [-128,-7) S: [-128,-7) Exits: -8 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr U: [128,249) S: [-128,-7) Exits: -8 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,6) S: [1,6) Exits: 5 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.ashr.next = ashr i8 %iv.ashr, 1 -; CHECK-NEXT: --> %iv.ashr.next U: [-64,0) S: [-64,0) Exits: -4 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr.next U: [192,0) S: [-64,0) Exits: -4 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_ashr_tc_negative ; CHECK-NEXT: Loop %loop: backedge-taken count is 4 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4 @@ -580,15 +580,15 @@ ; CHECK-LABEL: 'test_ashr_tc_either' ; CHECK-NEXT: Classifying expressions for: @test_ashr_tc_either ; CHECK-NEXT: %start = sext i1 %a to i8 -; CHECK-NEXT: --> (sext i1 %a to i8) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 %a to i8) U: [255,1) S: [-1,1) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,61) S: [0,61) Exits: 60 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.ashr = phi i8 [ %start, %entry ], [ %iv.ashr.next, %loop ] -; CHECK-NEXT: --> %iv.ashr U: [-16,16) S: [-16,16) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr U: [240,16) S: [-16,16) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,62) S: [1,62) Exits: 61 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.ashr.next = ashr i8 %iv.ashr, 1 -; CHECK-NEXT: --> %iv.ashr.next U: [-16,16) S: [-16,16) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.ashr.next U: [240,16) S: [-16,16) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_ashr_tc_either ; CHECK-NEXT: Loop %loop: backedge-taken count is 60 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 60 @@ -685,7 +685,7 @@ ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,6) S: [1,6) Exits: 5 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.lshr.next = lshr i8 %iv.lshr, 1 -; CHECK-NEXT: --> (%iv.lshr /u 2) U: [7,-128) S: [7,-128) Exits: 7 LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (%iv.lshr /u 2) U: [7,128) S: [7,-128) Exits: 7 LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_lshr_tc_negative ; CHECK-NEXT: Loop %loop: backedge-taken count is 4 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4 @@ -711,15 +711,15 @@ ; CHECK-LABEL: 'test_lshr_tc_either' ; CHECK-NEXT: Classifying expressions for: @test_lshr_tc_either ; CHECK-NEXT: %start = sext i1 %a to i8 -; CHECK-NEXT: --> (sext i1 %a to i8) U: [-1,1) S: [-1,1) +; CHECK-NEXT: --> (sext i1 %a to i8) U: [255,1) S: [-1,1) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,5) S: [0,5) Exits: 4 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.lshr = phi i8 [ %start, %entry ], [ %iv.lshr.next, %loop ] -; CHECK-NEXT: --> %iv.lshr U: [-1,-128) S: [-1,-128) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> %iv.lshr U: [255,128) S: [-1,-128) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,6) S: [1,6) Exits: 5 LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.lshr.next = lshr i8 %iv.lshr, 1 -; CHECK-NEXT: --> (%iv.lshr /u 2) U: [0,-128) S: [0,-128) Exits: <> LoopDispositions: { %loop: Variant } +; CHECK-NEXT: --> (%iv.lshr /u 2) U: [0,128) S: [0,-128) Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test_lshr_tc_either ; CHECK-NEXT: Loop %loop: backedge-taken count is 4 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 4 diff --git a/llvm/test/Analysis/ScalarEvolution/shl-lshr-differentconstmask.ll b/llvm/test/Analysis/ScalarEvolution/shl-lshr-differentconstmask.ll --- a/llvm/test/Analysis/ScalarEvolution/shl-lshr-differentconstmask.ll +++ b/llvm/test/Analysis/ScalarEvolution/shl-lshr-differentconstmask.ll @@ -6,9 +6,9 @@ ; CHECK-LABEL: 'mul_biggerShl' ; CHECK-NEXT: Classifying expressions for: @mul_biggerShl ; CHECK-NEXT: %tmp1 = mul i32 %val, 64 -; CHECK-NEXT: --> (64 * %val) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * %val) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: %tmp2 = udiv i32 %tmp1, 16 -; CHECK-NEXT: --> ((64 * %val) /u 16) U: [0,268435453) S: [0,268435456) +; CHECK-NEXT: --> ((64 * %val) /u 16) U: [0,268435453) S: [0,268435456) ; CHECK-NEXT: Determining loop execution counts for: @mul_biggerShl ; %tmp1 = mul i32 %val, 64 @@ -20,9 +20,9 @@ ; CHECK-LABEL: 'mul_biggerLshl' ; CHECK-NEXT: Classifying expressions for: @mul_biggerLshl ; CHECK-NEXT: %tmp1 = mul i32 %val, 16 -; CHECK-NEXT: --> (16 * %val) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %val) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: %tmp2 = udiv i32 %tmp1, 64 -; CHECK-NEXT: --> ((16 * %val) /u 64) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> ((16 * %val) /u 64) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: Determining loop execution counts for: @mul_biggerLshl ; %tmp1 = mul i32 %val, 16 @@ -36,9 +36,9 @@ ; CHECK-LABEL: 'shifty_biggerShl' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerShl ; CHECK-NEXT: %tmp1 = shl i32 %val, 6 -; CHECK-NEXT: --> (64 * %val) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * %val) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: %tmp2 = lshr i32 %tmp1, 4 -; CHECK-NEXT: --> ((64 * %val) /u 16) U: [0,268435453) S: [0,268435456) +; CHECK-NEXT: --> ((64 * %val) /u 16) U: [0,268435453) S: [0,268435456) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerShl ; %tmp1 = shl i32 %val, 6 @@ -50,9 +50,9 @@ ; CHECK-LABEL: 'shifty_biggerShl_shlnuw' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerShl_shlnuw ; CHECK-NEXT: %tmp1 = shl nuw i32 %val, 6 -; CHECK-NEXT: --> (64 * %val) U: [0,-63) S: [-2147483648,2147483585) +; CHECK-NEXT: --> (64 * %val) U: [0,4294967233) S: [-2147483648,2147483585) ; CHECK-NEXT: %tmp2 = lshr i32 %tmp1, 4 -; CHECK-NEXT: --> ((64 * %val) /u 16) U: [0,268435453) S: [0,268435456) +; CHECK-NEXT: --> ((64 * %val) /u 16) U: [0,268435453) S: [0,268435456) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerShl_shlnuw ; %tmp1 = shl nuw i32 %val, 6 @@ -64,9 +64,9 @@ ; CHECK-LABEL: 'shifty_biggerLshr' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerLshr ; CHECK-NEXT: %tmp1 = shl i32 %val, 4 -; CHECK-NEXT: --> (16 * %val) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %val) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: %tmp2 = lshr i32 %tmp1, 6 -; CHECK-NEXT: --> ((16 * %val) /u 64) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> ((16 * %val) /u 64) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerLshr ; %tmp1 = shl i32 %val, 4 @@ -78,9 +78,9 @@ ; CHECK-LABEL: 'shifty_biggerLshr_shlnuw' ; CHECK-NEXT: Classifying expressions for: @shifty_biggerLshr_shlnuw ; CHECK-NEXT: %tmp1 = shl nuw i32 %val, 4 -; CHECK-NEXT: --> (16 * %val) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %val) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: %tmp2 = lshr i32 %tmp1, 6 -; CHECK-NEXT: --> ((16 * %val) /u 64) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> ((16 * %val) /u 64) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: Determining loop execution counts for: @shifty_biggerLshr_shlnuw ; %tmp1 = shl nuw i32 %val, 4 @@ -94,9 +94,9 @@ ; CHECK-LABEL: 'masky_biggerShl' ; CHECK-NEXT: Classifying expressions for: @masky_biggerShl ; CHECK-NEXT: %tmp1 = shl i32 %val, 2 -; CHECK-NEXT: --> (4 * %val) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %val) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %tmp2 = and i32 %tmp1, 268435452 -; CHECK-NEXT: --> (4 * (zext i26 (trunc i32 %val to i26) to i32)) U: [0,268435453) S: [0,268435453) +; CHECK-NEXT: --> (4 * (zext i26 (trunc i32 %val to i26) to i32)) U: [0,268435453) S: [0,268435453) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerShl ; %tmp1 = shl i32 %val, 2 @@ -108,7 +108,7 @@ ; CHECK-LABEL: 'masky_biggerShl_shlnuw' ; CHECK-NEXT: Classifying expressions for: @masky_biggerShl_shlnuw ; CHECK-NEXT: %tmp1 = shl nuw i32 %val, 2 -; CHECK-NEXT: --> (4 * %val) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %val) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerShl_shlnuw ; %tmp1 = shl nuw i32 %val, 2 @@ -119,9 +119,9 @@ ; CHECK-LABEL: 'masky_biggerLshr' ; CHECK-NEXT: Classifying expressions for: @masky_biggerLshr ; CHECK-NEXT: %tmp1 = lshr i32 %val, 2 -; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) +; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: %tmp2 = and i32 %tmp1, 67108863 -; CHECK-NEXT: --> (zext i26 (trunc i32 (%val /u 4) to i26) to i32) U: [0,67108864) S: [0,67108864) +; CHECK-NEXT: --> (zext i26 (trunc i32 (%val /u 4) to i26) to i32) U: [0,67108864) S: [0,67108864) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerLshr ; %tmp1 = lshr i32 %val, 2 @@ -133,7 +133,7 @@ ; CHECK-LABEL: 'masky_biggerLshr_shlnuw' ; CHECK-NEXT: Classifying expressions for: @masky_biggerLshr_shlnuw ; CHECK-NEXT: %tmp1 = lshr i32 %val, 2 -; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) +; CHECK-NEXT: --> (%val /u 4) U: [0,1073741824) S: [0,1073741824) ; CHECK-NEXT: Determining loop execution counts for: @masky_biggerLshr_shlnuw ; %tmp1 = lshr i32 %val, 2 diff --git a/llvm/test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll b/llvm/test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll --- a/llvm/test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll +++ b/llvm/test/Analysis/ScalarEvolution/solve-quadratic-overflow.ll @@ -11,17 +11,17 @@ ; CHECK-LABEL: 'f0' ; CHECK-NEXT: Classifying expressions for: @f0 ; CHECK-NEXT: %v1 = phi i16 [ 0, %b0 ], [ %v2, %b1 ] -; CHECK-NEXT: --> {0,+,-1}<%b1> U: [-255,1) S: [-255,1) Exits: -255 LoopDispositions: { %b1: Computable } +; CHECK-NEXT: --> {0,+,-1}<%b1> U: [65281,1) S: [-255,1) Exits: -255 LoopDispositions: { %b1: Computable } ; CHECK-NEXT: %v2 = add i16 %v1, -1 -; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [-256,0) S: [-256,0) Exits: -256 LoopDispositions: { %b1: Computable } +; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [65280,0) S: [-256,0) Exits: -256 LoopDispositions: { %b1: Computable } ; CHECK-NEXT: %v3 = mul i16 %v2, %v2 ; CHECK-NEXT: --> {1,+,3,+,2}<%b1> U: full-set S: full-set Exits: 0 LoopDispositions: { %b1: Computable } ; CHECK-NEXT: %v5 = phi i16 [ %v2, %b1 ] -; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [-256,0) S: [-256,0) --> -256 U: [-256,-255) S: [-256,-255) +; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [65280,0) S: [-256,0) --> -256 U: [65280,65281) S: [-256,-255) ; CHECK-NEXT: %v6 = phi i16 [ %v3, %b1 ] ; CHECK-NEXT: --> {1,+,3,+,2}<%b1> U: full-set S: full-set --> 0 U: [0,1) S: [0,1) ; CHECK-NEXT: %v7 = sext i16 %v5 to i32 -; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [-256,0) S: [-256,0) --> -256 U: [-256,-255) S: [-256,-255) +; CHECK-NEXT: --> {-1,+,-1}<%b1> U: [4294967040,0) S: [-256,0) --> -256 U: [4294967040,4294967041) S: [-256,-255) ; CHECK-NEXT: Determining loop execution counts for: @f0 ; CHECK-NEXT: Loop %b1: backedge-taken count is 255 ; CHECK-NEXT: Loop %b1: constant max backedge-taken count is 255 diff --git a/llvm/test/Analysis/ScalarEvolution/srem.ll b/llvm/test/Analysis/ScalarEvolution/srem.ll --- a/llvm/test/Analysis/ScalarEvolution/srem.ll +++ b/llvm/test/Analysis/ScalarEvolution/srem.ll @@ -8,17 +8,17 @@ ; CHECK-LABEL: '_Z4loopi' ; CHECK-NEXT: Classifying expressions for: @_Z4loopi ; CHECK-NEXT: %storage = alloca [2 x i32], align 4 -; CHECK-NEXT: --> %storage U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> %storage U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %0 = bitcast ptr %storage to ptr -; CHECK-NEXT: --> %storage U: [0,-3) S: [-9223372036854775808,9223372036854775805) +; CHECK-NEXT: --> %storage U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) ; CHECK-NEXT: %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.cond> U: [0,-2147483648) S: [0,-2147483648) Exits: %width LoopDispositions: { %for.cond: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.cond> U: [0,2147483648) S: [0,-2147483648) Exits: %width LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %rem = srem i32 %i.0, 2 ; CHECK-NEXT: --> (zext i1 {false,+,true}<%for.cond> to i32) U: [0,2) S: [0,2) Exits: (zext i1 (trunc i32 %width to i1) to i32) LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %idxprom = sext i32 %rem to i64 ; CHECK-NEXT: --> (zext i1 {false,+,true}<%for.cond> to i64) U: [0,2) S: [0,2) Exits: (zext i1 (trunc i32 %width to i1) to i64) LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %arrayidx = getelementptr inbounds [2 x i32], ptr %storage, i64 0, i64 %idxprom -; CHECK-NEXT: --> ((4 * (zext i1 {false,+,true}<%for.cond> to i64)) + %storage) U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: ((4 * (zext i1 (trunc i32 %width to i1) to i64)) + %storage) LoopDispositions: { %for.cond: Computable } +; CHECK-NEXT: --> ((4 * (zext i1 {false,+,true}<%for.cond> to i64)) + %storage) U: [0,18446744073709551613) S: [-9223372036854775808,9223372036854775805) Exits: ((4 * (zext i1 (trunc i32 %width to i1) to i64)) + %storage) LoopDispositions: { %for.cond: Computable } ; CHECK-NEXT: %1 = load i32, ptr %arrayidx, align 4 ; CHECK-NEXT: --> %1 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %call = call i32 @_Z3adji(i32 %1) diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count-minmax.ll b/llvm/test/Analysis/ScalarEvolution/trip-count-minmax.ll --- a/llvm/test/Analysis/ScalarEvolution/trip-count-minmax.ll +++ b/llvm/test/Analysis/ScalarEvolution/trip-count-minmax.ll @@ -10,7 +10,7 @@ ; CHECK-NEXT: %cond = select i1 %cmp, i32 %a, i32 %b ; CHECK-NEXT: --> (%a umin %b) U: full-set S: full-set ; CHECK-NEXT: %i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + (%a umin %b)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + (%a umin %b)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.08, 1 ; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,0) S: [1,0) Exits: (%a umin %b) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @nomulitply @@ -50,15 +50,15 @@ ; CHECK-LABEL: 'umin' ; CHECK-NEXT: Classifying expressions for: @umin ; CHECK-NEXT: %mul = shl i32 %a, 1 -; CHECK-NEXT: --> (2 * %a) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * %a) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %mul1 = shl i32 %b, 2 -; CHECK-NEXT: --> (4 * %b) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %b) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %cond = select i1 %cmp, i32 %mul, i32 %mul1 -; CHECK-NEXT: --> ((2 * %a) umin (4 * %b)) U: [0,-3) S: [-2147483648,2147483647) +; CHECK-NEXT: --> ((2 * %a) umin (4 * %b)) U: [0,4294967293) S: [-2147483648,2147483647) ; CHECK-NEXT: %i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) umin (4 * %b))) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) umin (4 * %b))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.011, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-3) S: [1,-3) Exits: ((2 * %a) umin (4 * %b)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,4294967293) S: [1,-3) Exits: ((2 * %a) umin (4 * %b)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @umin ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + ((2 * %a) umin (4 * %b))) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -5 @@ -100,15 +100,15 @@ ; CHECK-LABEL: 'umax' ; CHECK-NEXT: Classifying expressions for: @umax ; CHECK-NEXT: %mul = shl i32 %a, 1 -; CHECK-NEXT: --> (2 * %a) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * %a) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %mul1 = shl i32 %b, 2 -; CHECK-NEXT: --> (4 * %b) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %b) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %cond = select i1 %cmp, i32 %mul, i32 %mul1 -; CHECK-NEXT: --> ((2 * %a) umax (4 * %b)) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> ((2 * %a) umax (4 * %b)) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) umax (4 * %b))) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) umax (4 * %b))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.011, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-1) S: [1,-1) Exits: ((2 * %a) umax (4 * %b)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,4294967295) S: [1,-1) Exits: ((2 * %a) umax (4 * %b)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @umax ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + ((2 * %a) umax (4 * %b))) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -3 @@ -150,15 +150,15 @@ ; CHECK-LABEL: 'smin' ; CHECK-NEXT: Classifying expressions for: @smin ; CHECK-NEXT: %mul = shl nsw i32 %a, 1 -; CHECK-NEXT: --> (2 * %a) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * %a) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %mul1 = shl nsw i32 %b, 2 -; CHECK-NEXT: --> (4 * %b) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %b) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %cond = select i1 %cmp, i32 %mul, i32 %mul1 -; CHECK-NEXT: --> ((2 * %a) smin (4 * %b)) U: [0,-1) S: [-2147483648,2147483645) +; CHECK-NEXT: --> ((2 * %a) smin (4 * %b)) U: [0,4294967295) S: [-2147483648,2147483645) ; CHECK-NEXT: %i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) smin (4 * %b))) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) smin (4 * %b))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.011, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-1) S: [1,-1) Exits: ((2 * %a) smin (4 * %b)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,4294967295) S: [1,-1) Exits: ((2 * %a) smin (4 * %b)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @smin ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + ((2 * %a) smin (4 * %b))) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -3 @@ -199,15 +199,15 @@ ; CHECK-LABEL: 'smax' ; CHECK-NEXT: Classifying expressions for: @smax ; CHECK-NEXT: %mul = shl nsw i32 %a, 1 -; CHECK-NEXT: --> (2 * %a) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * %a) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %mul1 = shl nsw i32 %b, 2 -; CHECK-NEXT: --> (4 * %b) U: [0,-3) S: [-2147483648,2147483645) +; CHECK-NEXT: --> (4 * %b) U: [0,4294967293) S: [-2147483648,2147483645) ; CHECK-NEXT: %cond = select i1 %cmp, i32 %mul, i32 %mul1 -; CHECK-NEXT: --> ((2 * %a) smax (4 * %b)) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> ((2 * %a) smax (4 * %b)) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) smax (4 * %b))) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + ((2 * %a) smax (4 * %b))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.011, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-1) S: [1,-1) Exits: ((2 * %a) smax (4 * %b)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,4294967295) S: [1,-1) Exits: ((2 * %a) smax (4 * %b)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @smax ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + ((2 * %a) smax (4 * %b))) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -3 @@ -248,13 +248,13 @@ ; CHECK-LABEL: 'umin_seq2' ; CHECK-NEXT: Classifying expressions for: @umin_seq2 ; CHECK-NEXT: %n.2 = shl nsw i32 %n, 1 -; CHECK-NEXT: --> (2 * %n) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (2 * %n) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %m.2 = shl nsw i32 %m, 4 -; CHECK-NEXT: --> (16 * %m) U: [0,-15) S: [-2147483648,2147483633) +; CHECK-NEXT: --> (16 * %m) U: [0,4294967281) S: [-2147483648,2147483633) ; CHECK-NEXT: %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] -; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: ((-1 + (1 umax (2 * %n))) umin_seq (-1 + (1 umax (16 * %m)))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,2147483648) S: [0,-2147483648) Exits: ((-1 + (1 umax (2 * %n))) umin_seq (-1 + (1 umax (16 * %m)))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %i.next = add nuw nsw i32 %i, 1 -; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-15) S: [1,-15) Exits: (1 + ((-1 + (1 umax (2 * %n))) umin_seq (-1 + (1 umax (16 * %m))))) LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,4294967281) S: [1,-15) Exits: (1 + ((-1 + (1 umax (2 * %n))) umin_seq (-1 + (1 umax (16 * %m))))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %cond = select i1 %cond_p0, i1 %cond_p1, i1 false ; CHECK-NEXT: --> (%cond_p0 umin_seq %cond_p1) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @umin_seq2 @@ -288,13 +288,13 @@ ; CHECK-NEXT: %mul = mul i32 %a, 3 ; CHECK-NEXT: --> (3 * %a) U: full-set S: full-set ; CHECK-NEXT: %mul1 = mul i32 %b, 6 -; CHECK-NEXT: --> (6 * %b) U: [0,-1) S: [-2147483648,2147483647) +; CHECK-NEXT: --> (6 * %b) U: [0,4294967295) S: [-2147483648,2147483647) ; CHECK-NEXT: %cond = select i1 %cmp, i32 %mul, i32 %mul1 -; CHECK-NEXT: --> ((3 * %a) umin (6 * %b)) U: [0,-1) S: full-set +; CHECK-NEXT: --> ((3 * %a) umin (6 * %b)) U: [0,4294967295) S: full-set ; CHECK-NEXT: %i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + ((3 * %a) umin (6 * %b))) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,2147483648) S: [0,-2147483648) Exits: (-1 + ((3 * %a) umin (6 * %b))) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add nuw nsw i32 %i.011, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-1) S: [1,-1) Exits: ((3 * %a) umin (6 * %b)) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,4294967295) S: [1,-1) Exits: ((3 * %a) umin (6 * %b)) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @umin-3and6 ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + ((3 * %a) umin (6 * %b))) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -3 diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count-non-unit-stride.ll b/llvm/test/Analysis/ScalarEvolution/trip-count-non-unit-stride.ll --- a/llvm/test/Analysis/ScalarEvolution/trip-count-non-unit-stride.ll +++ b/llvm/test/Analysis/ScalarEvolution/trip-count-non-unit-stride.ll @@ -8,9 +8,9 @@ ; CHECK-LABEL: 'test_preinc_ult' ; CHECK-NEXT: Classifying expressions for: @test_preinc_ult ; CHECK-NEXT: %iv = phi i64 [ 0, %start ], [ %iv.inc2, %latch ] -; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc2 = add nuw i64 %iv, 2 -; CHECK-NEXT: --> {2,+,2}<%loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {2,+,2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_preinc_ult ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: ***COULDNOTCOMPUTE*** @@ -42,11 +42,11 @@ ; CHECK-LABEL: 'test_postinc_ult' ; CHECK-NEXT: Classifying expressions for: @test_postinc_ult ; CHECK-NEXT: %iv = phi i64 [ 0, %start ], [ %iv.inc2, %latch ] -; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc = add nuw i64 %iv, 1 ; CHECK-NEXT: --> {1,+,2}<%loop> U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc2 = add nuw i64 %iv, 2 -; CHECK-NEXT: --> {2,+,2}<%loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {2,+,2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_postinc_ult ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: ***COULDNOTCOMPUTE*** @@ -79,9 +79,9 @@ ; CHECK-LABEL: 'test_preinc_slt' ; CHECK-NEXT: Classifying expressions for: @test_preinc_slt ; CHECK-NEXT: %iv = phi i64 [ 0, %start ], [ %iv.inc2, %latch ] -; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,-9223372036854775808) S: [0,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,9223372036854775808) S: [0,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc2 = add nsw i64 %iv, 2 -; CHECK-NEXT: --> {2,+,2}<%loop> U: [2,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {2,+,2}<%loop> U: [2,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_preinc_slt ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: ***COULDNOTCOMPUTE*** @@ -113,11 +113,11 @@ ; CHECK-LABEL: 'test_postinc_slt' ; CHECK-NEXT: Classifying expressions for: @test_postinc_slt ; CHECK-NEXT: %iv = phi i64 [ 0, %start ], [ %iv.inc2, %latch ] -; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,-9223372036854775808) S: [0,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,2}<%loop> U: [0,9223372036854775808) S: [0,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc = add nsw i64 %iv, 1 -; CHECK-NEXT: --> {1,+,2}<%loop> U: [1,-9223372036854775808) S: [1,-9223372036854775808) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {1,+,2}<%loop> U: [1,9223372036854775808) S: [1,-9223372036854775808) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc2 = add nsw i64 %iv, 2 -; CHECK-NEXT: --> {2,+,2}<%loop> U: [2,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {2,+,2}<%loop> U: [2,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_postinc_slt ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: ***COULDNOTCOMPUTE*** @@ -150,9 +150,9 @@ ; CHECK-LABEL: 'test_preinc_sgt' ; CHECK-NEXT: Classifying expressions for: @test_preinc_sgt ; CHECK-NEXT: %iv = phi i64 [ 0, %start ], [ %iv.inc2, %latch ] -; CHECK-NEXT: --> {0,+,-2}<%loop> U: [0,-1) S: [-9223372036854775808,1) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,-2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,1) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc2 = add nsw i64 %iv, -2 -; CHECK-NEXT: --> {-2,+,-2}<%loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-2,+,-2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_preinc_sgt ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: ***COULDNOTCOMPUTE*** @@ -184,11 +184,11 @@ ; CHECK-LABEL: 'test_postinc_sgt' ; CHECK-NEXT: Classifying expressions for: @test_postinc_sgt ; CHECK-NEXT: %iv = phi i64 [ 0, %start ], [ %iv.inc2, %latch ] -; CHECK-NEXT: --> {0,+,-2}<%loop> U: [0,-1) S: [-9223372036854775808,1) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {0,+,-2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,1) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc = add nsw i64 %iv, -1 -; CHECK-NEXT: --> {-1,+,-2}<%loop> U: [-9223372036854775808,0) S: [-9223372036854775808,0) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-1,+,-2}<%loop> U: [9223372036854775808,0) S: [-9223372036854775808,0) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.inc2 = add nsw i64 %iv, -2 -; CHECK-NEXT: --> {-2,+,-2}<%loop> U: [0,-1) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } +; CHECK-NEXT: --> {-2,+,-2}<%loop> U: [0,18446744073709551615) S: [-9223372036854775808,9223372036854775807) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_postinc_sgt ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. ; CHECK-NEXT: exit count for loop: ***COULDNOTCOMPUTE*** diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count15.ll b/llvm/test/Analysis/ScalarEvolution/trip-count15.ll --- a/llvm/test/Analysis/ScalarEvolution/trip-count15.ll +++ b/llvm/test/Analysis/ScalarEvolution/trip-count15.ll @@ -67,7 +67,7 @@ ; CHECK-LABEL: 'smin_signed_check' ; CHECK-NEXT: Classifying expressions for: @smin_signed_check ; CHECK-NEXT: %min.n = select i1 %min.cmp, i64 4096, i64 %n -; CHECK-NEXT: --> (4096 smin %n) U: [-9223372036854775808,4097) S: [-9223372036854775808,4097) +; CHECK-NEXT: --> (4096 smin %n) U: [9223372036854775808,4097) S: [-9223372036854775808,4097) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4098) S: [0,4098) Exits: (0 smax (1 + (4096 smin %n))) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 @@ -98,7 +98,7 @@ ; CHECK-LABEL: 'smin_unsigned_check' ; CHECK-NEXT: Classifying expressions for: @smin_unsigned_check ; CHECK-NEXT: %min.n = select i1 %min.cmp, i64 4096, i64 %n -; CHECK-NEXT: --> (4096 smin %n) U: [-9223372036854775808,4097) S: [-9223372036854775808,4097) +; CHECK-NEXT: --> (4096 smin %n) U: [9223372036854775808,4097) S: [-9223372036854775808,4097) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 diff --git a/llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll b/llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll --- a/llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll +++ b/llvm/test/Analysis/ScalarEvolution/trip-multiple-guard-info.ll @@ -9,9 +9,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4 ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -44,9 +44,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_guard ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -80,9 +80,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_ugt_5 ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -116,9 +116,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_ugt_5_order_swapped ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -153,7 +153,7 @@ ; 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: %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,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: constant max backedge-taken count is 2147483646 @@ -189,7 +189,7 @@ ; 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: %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,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: constant max backedge-taken count is 2147483646 @@ -222,9 +222,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_uge_5 ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -258,9 +258,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_uge_5_order_swapped ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -296,7 +296,7 @@ ; 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: %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,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: constant max backedge-taken count is 2147483646 @@ -331,7 +331,7 @@ ; 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: %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,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: constant max backedge-taken count is 2147483646 @@ -365,9 +365,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_icmp_ops_swapped ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -400,9 +400,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) 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 @@ -437,9 +437,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) 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 @@ -474,9 +474,9 @@ ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) 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 @@ -511,9 +511,9 @@ ; CHECK-NEXT: %u = urem i32 %num, 5 ; CHECK-NEXT: --> ((-5 * (%num /u 5)) + %num) U: full-set S: full-set ; 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,2147483648) S: [0,-2147483648) 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,2147483648) S: [1,-2147483648) Exits: %num LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_5 ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %num) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -2 @@ -548,9 +548,9 @@ ; CHECK-NEXT: %and = and i32 %conv, 1 ; CHECK-NEXT: --> (zext i1 (trunc i64 %N to i1) to i32) U: [0,2) S: [0,2) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] -; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + %N) LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,1}<%for.body> U: [0,9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + %N) LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %iv.next = add nuw nsw i64 %iv, 1 -; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,-9223372036854775808) S: [1,-9223372036854775808) Exits: %N LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {1,+,1}<%for.body> U: [1,9223372036854775808) S: [1,-9223372036854775808) Exits: %N LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trunc_operand_larger_than_urem_expr ; CHECK-NEXT: Loop %for.body: backedge-taken count is (-1 + %N) ; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is -1 @@ -582,9 +582,9 @@ ; 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,+,4}<%for.body> U: [0,-3) S: [-2147483648,2147483645) Exits: <> LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {0,+,4}<%for.body> U: [0,4294967293) S: [-2147483648,2147483645) Exits: <> LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: %inc = add i32 %i.010, 4 -; CHECK-NEXT: --> {4,+,4}<%for.body> U: [0,-3) S: [-2147483648,2147483645) Exits: <> LoopDispositions: { %for.body: Computable } +; CHECK-NEXT: --> {4,+,4}<%for.body> U: [0,4294967293) S: [-2147483648,2147483645) Exits: <> LoopDispositions: { %for.body: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test_trip_multiple_4_vectorized_iv ; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count. ; CHECK-NEXT: Loop %for.body: Unpredictable constant max backedge-taken count. diff --git a/llvm/test/Analysis/ScalarEvolution/umin-umax-folds.ll b/llvm/test/Analysis/ScalarEvolution/umin-umax-folds.ll --- a/llvm/test/Analysis/ScalarEvolution/umin-umax-folds.ll +++ b/llvm/test/Analysis/ScalarEvolution/umin-umax-folds.ll @@ -7,7 +7,7 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 @@ -43,7 +43,7 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 @@ -79,13 +79,13 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + (sext i32 %len to i64)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %sel = select i1 %cmp1, i64 %len.zext, i64 %len.sext -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Invariant } +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: Determining loop execution counts for: @uge_sext_x_zext_x ; CHECK-NEXT: Loop %loop: backedge-taken count is (sext i32 %len to i64) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -115,7 +115,7 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 @@ -151,13 +151,13 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + (sext i32 %len to i64)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %umax = select i1 %cmp1, i64 %len.zext, i64 %len.sext -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Invariant } +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: Determining loop execution counts for: @ugt_sext_x_zext_x ; CHECK-NEXT: Loop %loop: backedge-taken count is (sext i32 %len to i64) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -187,7 +187,7 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 @@ -223,7 +223,7 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 @@ -259,13 +259,13 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + (sext i32 %len to i64)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %umin = select i1 %cmp1, i64 %len.zext, i64 %len.sext -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Invariant } +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) Exits: (sext i32 %len to i64) LoopDispositions: { %loop: Invariant } ; CHECK-NEXT: Determining loop execution counts for: @slt_sext_x_zext_x ; CHECK-NEXT: Loop %loop: backedge-taken count is (sext i32 %len to i64) ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1 @@ -295,7 +295,7 @@ ; CHECK-NEXT: %len.zext = zext i32 %len to i64 ; CHECK-NEXT: --> (zext i32 %len to i64) U: [0,4294967296) S: [0,4294967296) ; CHECK-NEXT: %len.sext = sext i32 %len to i64 -; CHECK-NEXT: --> (sext i32 %len to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) +; CHECK-NEXT: --> (sext i32 %len to i64) U: [18446744071562067968,2147483648) S: [-2147483648,2147483648) ; CHECK-NEXT: %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 %len to i64) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %iv.next = add i64 %iv, 1 diff --git a/llvm/test/Analysis/ScalarEvolution/urem-0.ll b/llvm/test/Analysis/ScalarEvolution/urem-0.ll --- a/llvm/test/Analysis/ScalarEvolution/urem-0.ll +++ b/llvm/test/Analysis/ScalarEvolution/urem-0.ll @@ -49,7 +49,7 @@ ; CHECK-LABEL: 'test_and_not' ; CHECK-NEXT: Classifying expressions for: @test_and_not ; CHECK-NEXT: %andn = and i32 %arg, -8 -; CHECK-NEXT: --> (8 * (%arg /u 8)) U: [0,-7) S: [-2147483648,2147483641) +; CHECK-NEXT: --> (8 * (%arg /u 8)) U: [0,4294967289) S: [-2147483648,2147483641) ; CHECK-NEXT: Determining loop execution counts for: @test_and_not ; %andn = and i32 %arg, -8 @@ -62,7 +62,7 @@ ; CHECK-NEXT: %urem = urem i32 %arg, 8 ; CHECK-NEXT: --> (zext i3 (trunc i32 %arg to i3) to i32) U: [0,8) S: [0,8) ; CHECK-NEXT: %sub = sub i32 %arg, %urem -; CHECK-NEXT: --> (8 * (%arg /u 8)) U: [0,-7) S: [-2147483648,2147483641) +; CHECK-NEXT: --> (8 * (%arg /u 8)) U: [0,4294967289) S: [-2147483648,2147483641) ; CHECK-NEXT: Determining loop execution counts for: @test_sub_urem ; %urem = urem i32 %arg, 8 @@ -78,7 +78,7 @@ ; CHECK-NEXT: %zext = zext i3 %trunc to i32 ; CHECK-NEXT: --> (zext i3 (trunc i32 %arg to i3) to i32) U: [0,8) S: [0,8) ; CHECK-NEXT: %sub = sub i32 %arg, %zext -; CHECK-NEXT: --> (8 * (%arg /u 8)) U: [0,-7) S: [-2147483648,2147483641) +; CHECK-NEXT: --> (8 * (%arg /u 8)) U: [0,4294967289) S: [-2147483648,2147483641) ; CHECK-NEXT: Determining loop execution counts for: @test_trunc_zext ; %trunc = trunc i32 %arg to i3 diff --git a/llvm/test/Other/constant-fold-gep.ll b/llvm/test/Other/constant-fold-gep.ll --- a/llvm/test/Other/constant-fold-gep.ll +++ b/llvm/test/Other/constant-fold-gep.ll @@ -191,9 +191,9 @@ ; SCEV: %t = bitcast ptr getelementptr (i1, ptr inttoptr (i32 1 to ptr), i32 -2) to ptr ; SCEV: --> (-2 + inttoptr (i32 1 to ptr)) ; SCEV: Classifying expressions for: @hoo8 -; SCEV: --> (-1 + null) U: [-1,0) S: [-1,0) +; SCEV: --> (-1 + null) U: [18446744073709551615,0) S: [-1,0) ; SCEV: Classifying expressions for: @hoo1 -; SCEV: --> (-1 + null) U: [-1,0) S: [-1,0) +; SCEV: --> (-1 + null) U: [18446744073709551615,0) S: [-1,0) define ptr @goo8() nounwind { %t = bitcast ptr getelementptr (i8, ptr inttoptr (i32 1 to ptr), i32 -1) to ptr