Skip to content

Commit

Permalink
[SCEV] Use both known bits and sign bits when computing range of SCEV…
Browse files Browse the repository at this point in the history
… unknowns

When computing a range for a SCEVUnknown, today we use computeKnownBits for unsigned ranges, and computeNumSignBots for signed ranges. This means we miss opportunities to improve range results.

One common missed pattern is that we have a signed range of a value which CKB can determine is positive, but CNSB doesn't convey that information. The current range includes the negative part, and is thus double the size.

Per the removed comment, the original concern which delayed using both (after some code merging years back) was a compile time concern. CTMark results (provided by Nikita, thanks!) showed a geomean impact of about 0.1%. This doesn't seem large enough to avoid higher quality results.

Differential Revision: https://reviews.llvm.org/D96534
  • Loading branch information
preames committed Feb 19, 2021
1 parent bcb5a12 commit 4a5edea
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 84 deletions.
59 changes: 27 additions & 32 deletions llvm/lib/Analysis/ScalarEvolution.cpp
Expand Up @@ -5843,39 +5843,34 @@ ScalarEvolution::getRangeRef(const SCEV *S,
ConservativeResult = ConservativeResult.intersectWith(MDRange.getValue(),
RangeType);

// Split here to avoid paying the compile-time cost of calling both
// computeKnownBits and ComputeNumSignBits. This restriction can be lifted
// if needed.
// See if ValueTracking can give us a useful range.
const DataLayout &DL = getDataLayout();
if (SignHint == ScalarEvolution::HINT_RANGE_UNSIGNED) {
// For a SCEVUnknown, ask ValueTracking.
KnownBits Known = computeKnownBits(U->getValue(), DL, 0, &AC, nullptr, &DT);
if (Known.getBitWidth() != BitWidth)
Known = Known.zextOrTrunc(BitWidth);
// If Known does not result in full-set, intersect with it.
if (Known.getMinValue() != Known.getMaxValue() + 1)
ConservativeResult = ConservativeResult.intersectWith(
ConstantRange(Known.getMinValue(), Known.getMaxValue() + 1),
RangeType);
} else {
assert(SignHint == ScalarEvolution::HINT_RANGE_SIGNED &&
"generalize as needed!");
unsigned NS = ComputeNumSignBits(U->getValue(), DL, 0, &AC, nullptr, &DT);
// If the pointer size is larger than the index size type, this can cause
// NS to be larger than BitWidth. So compensate for this.
if (U->getType()->isPointerTy()) {
unsigned ptrSize = DL.getPointerTypeSizeInBits(U->getType());
int ptrIdxDiff = ptrSize - BitWidth;
if (ptrIdxDiff > 0 && ptrSize > BitWidth && NS > (unsigned)ptrIdxDiff)
NS -= ptrIdxDiff;
}

if (NS > 1)
ConservativeResult = ConservativeResult.intersectWith(
ConstantRange(APInt::getSignedMinValue(BitWidth).ashr(NS - 1),
APInt::getSignedMaxValue(BitWidth).ashr(NS - 1) + 1),
RangeType);
}
KnownBits Known = computeKnownBits(U->getValue(), DL, 0, &AC, nullptr, &DT);
if (Known.getBitWidth() != BitWidth)
Known = Known.zextOrTrunc(BitWidth);
// If Known does not result in full-set, intersect with it.
if (Known.getMinValue() != Known.getMaxValue() + 1)
ConservativeResult = ConservativeResult.intersectWith(
ConstantRange(Known.getMinValue(), Known.getMaxValue() + 1),
RangeType);

// ValueTracking may be able to compute a tighter result for the number of
// sign bits than for the value of those sign bits.
unsigned NS = ComputeNumSignBits(U->getValue(), DL, 0, &AC, nullptr, &DT);
// If the pointer size is larger than the index size type, this can cause
// NS to be larger than BitWidth. So compensate for this.
if (U->getType()->isPointerTy()) {
unsigned ptrSize = DL.getPointerTypeSizeInBits(U->getType());
int ptrIdxDiff = ptrSize - BitWidth;
if (ptrIdxDiff > 0 && ptrSize > BitWidth && NS > (unsigned)ptrIdxDiff)
NS -= ptrIdxDiff;
}

if (NS > 1)
ConservativeResult = ConservativeResult.intersectWith(
ConstantRange(APInt::getSignedMinValue(BitWidth).ashr(NS - 1),
APInt::getSignedMaxValue(BitWidth).ashr(NS - 1) + 1),
RangeType);

// A range of Phi is a subset of union of all ranges of its input.
if (const PHINode *Phi = dyn_cast<PHINode>(U->getValue())) {
Expand Down
Expand Up @@ -37,7 +37,7 @@ define i32 @d(i32 %base) {
; CHECK-NEXT: %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, ptrtoint ([1 x i32]* @b to i64)
; CHECK-NEXT: --> ((-1 * (ptrtoint [1 x i32]* @b to i64)) + (ptrtoint i32* %1 to i64)) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %for.cond: Variant }
; CHECK-NEXT: %sub.ptr.div = sdiv exact i64 %sub.ptr.sub, 4
; CHECK-NEXT: --> %sub.ptr.div U: full-set S: [-2305843009213693952,2305843009213693952) Exits: <<Unknown>> LoopDispositions: { %for.cond: Variant }
; CHECK-NEXT: --> %sub.ptr.div U: [-2305843009213693952,2305843009213693952) S: [-2305843009213693952,2305843009213693952) Exits: <<Unknown>> LoopDispositions: { %for.cond: Variant }
; CHECK-NEXT: %arrayidx1 = getelementptr inbounds [1 x i8], [1 x i8]* %arrayidx, i64 0, i64 %sub.ptr.div
; CHECK-NEXT: --> ({((sext i32 %base to i64) + %e),+,1}<nw><%for.cond> + %sub.ptr.div) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %for.cond: Variant }
; CHECK-NEXT: %2 = load i8, i8* %arrayidx1, align 1
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Analysis/ScalarEvolution/ashr.ll
Expand Up @@ -31,7 +31,7 @@ define i32 @t2(i32 %x, i32 %y) {
; CHECK-LABEL: 't2'
; CHECK-NEXT: Classifying expressions for: @t2
; CHECK-NEXT: %i0 = ashr i32 %x, 4
; CHECK-NEXT: --> %i0 U: full-set S: [-134217728,134217728)
; CHECK-NEXT: --> %i0 U: [-134217728,134217728) S: [-134217728,134217728)
; CHECK-NEXT: Determining loop execution counts for: @t2
;
%i0 = ashr i32 %x, 4
Expand Down
Expand Up @@ -21,7 +21,7 @@ define i32 @sdiv(i32 %val) nounwind {
; CHECK-LABEL: 'sdiv'
; CHECK-NEXT: Classifying expressions for: @sdiv
; CHECK-NEXT: %tmp1 = sdiv i32 %val, 16
; CHECK-NEXT: --> %tmp1 U: full-set S: [-134217728,134217728)
; CHECK-NEXT: --> %tmp1 U: [-134217728,134217728) S: [-134217728,134217728)
; CHECK-NEXT: %tmp2 = mul i32 %tmp1, 16
; CHECK-NEXT: --> (16 * %tmp1)<nsw> U: [0,-15) S: [-2147483648,2147483633)
; CHECK-NEXT: Determining loop execution counts for: @sdiv
Expand Down
36 changes: 18 additions & 18 deletions llvm/test/Analysis/ScalarEvolution/increasing-or-decreasing-iv.ll
Expand Up @@ -6,15 +6,15 @@ define void @f0(i1 %c) {
; CHECK-LABEL: 'f0'
; CHECK-NEXT: Classifying expressions for: @f0
; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0
; CHECK-NEXT: --> %start U: [0,128) S: [-128,128)
; CHECK-NEXT: --> %start U: [0,128) S: [0,128)
; CHECK-NEXT: %step = select i1 %c, i32 -1, i32 1
; CHECK-NEXT: --> %step U: [1,0) S: [-2,2)
; CHECK-NEXT: %loop.iv = phi i32 [ 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 ]
; CHECK-NEXT: --> {%start,+,%step}<%loop> U: [0,128) S: [0,128) Exits: ((127 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.next = add i32 %iv, %step
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-384,256) S: [-384,256) Exits: ((128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step)<nsw> + %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
Expand Down Expand Up @@ -45,7 +45,7 @@ define void @f1(i1 %c) {
; CHECK-LABEL: 'f1'
; CHECK-NEXT: Classifying expressions for: @f1
; CHECK-NEXT: %start = select i1 %c, i32 120, i32 0
; CHECK-NEXT: --> %start U: [0,121) S: [-128,128)
; 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: %loop.iv = phi i32 [ 0, %entry ], [ %loop.iv.inc, %loop ]
Expand Down Expand Up @@ -81,7 +81,7 @@ define void @f1(i1 %c) {
; CHECK-NEXT: %iv.m7 = sub i32 %iv, 7
; CHECK-NEXT: --> {(-7 + %start)<nsw>,+,%step}<%loop> U: [-7,114) S: [-7,114) Exits: (-7 + (15 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.next = add i32 %iv, %step
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [0,-7) S: [-384,368) Exits: ((16 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [0,-7) S: [-256,361) Exits: ((16 * %step)<nsw> + %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
Expand Down Expand Up @@ -131,17 +131,17 @@ define void @f2(i1 %c) {
; CHECK-LABEL: 'f2'
; CHECK-NEXT: Classifying expressions for: @f2
; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0
; CHECK-NEXT: --> %start U: [0,128) S: [-128,128)
; CHECK-NEXT: --> %start U: [0,128) S: [0,128)
; CHECK-NEXT: %step = select i1 %c, i32 -1, i32 1
; CHECK-NEXT: --> %step U: [1,0) S: [-2,2)
; CHECK-NEXT: %loop.iv = phi i32 [ 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 ]
; CHECK-NEXT: --> {%start,+,%step}<%loop> U: [0,128) S: [0,128) Exits: ((127 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.sext = sext i32 %iv to i64
; CHECK-NEXT: --> {(sext i32 %start to i64),+,(sext i32 %step to i64)}<nsw><%loop> U: [0,128) S: [0,128) Exits: ((sext i32 %start to i64) + (127 * (sext i32 %step to i64))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(zext i32 %start to i64),+,(sext i32 %step to i64)}<nsw><%loop> U: [0,128) S: [0,128) Exits: ((zext i32 %start to i64) + (127 * (sext i32 %step to i64))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.next = add i32 %iv, %step
; CHECK-NEXT: --> {(%step + %start),+,%step}<nw><%loop> U: [-384,256) S: [-384,256) Exits: ((128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(%step + %start),+,%step}<nw><%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step)<nsw> + %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
Expand Down Expand Up @@ -173,9 +173,9 @@ define void @f3(i1 %c) {
; CHECK-LABEL: 'f3'
; CHECK-NEXT: Classifying expressions for: @f3
; CHECK-NEXT: %start = select i1 %c, i16 1000, i16 0
; CHECK-NEXT: --> %start U: [0,1001) S: [-1024,1024)
; CHECK-NEXT: --> %start U: [0,1001) S: [0,1001)
; CHECK-NEXT: %step = select i1 %c, i16 1, i16 509
; CHECK-NEXT: --> %step U: [1,510) S: [-512,512)
; CHECK-NEXT: --> %step U: [1,510) S: [1,510)
; 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 ]
Expand Down Expand Up @@ -222,7 +222,7 @@ define void @f4(i1 %c) {
; CHECK-LABEL: 'f4'
; CHECK-NEXT: Classifying expressions for: @f4
; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0
; CHECK-NEXT: --> %start U: [0,128) S: [-128,128)
; CHECK-NEXT: --> %start U: [0,128) S: [0,128)
; CHECK-NEXT: %step = select i1 %c, i32 -1, i32 1
; CHECK-NEXT: --> %step U: [1,0) S: [-2,2)
; CHECK-NEXT: %loop.iv = phi i32 [ 0, %entry ], [ %loop.iv.inc, %loop ]
Expand All @@ -232,7 +232,7 @@ define void @f4(i1 %c) {
; 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))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.next = add i32 %iv, %step
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-384,256) S: [-384,256) Exits: ((128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step)<nsw> + %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
Expand Down Expand Up @@ -270,7 +270,7 @@ define void @f5(i1 %c) {
; CHECK-LABEL: 'f5'
; CHECK-NEXT: Classifying expressions for: @f5
; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0
; CHECK-NEXT: --> %start U: [0,128) S: [-128,128)
; CHECK-NEXT: --> %start U: [0,128) S: [0,128)
; CHECK-NEXT: %step = select i1 %c, i32 -1, i32 1
; CHECK-NEXT: --> %step U: [1,0) S: [-2,2)
; CHECK-NEXT: %loop.iv = phi i16 [ 0, %entry ], [ %loop.iv.inc, %loop ]
Expand All @@ -280,7 +280,7 @@ define void @f5(i1 %c) {
; 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))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.next = add i32 %iv, %step
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-384,256) S: [-384,256) Exits: ((128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step)<nsw> + %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
Expand Down Expand Up @@ -313,7 +313,7 @@ define void @f6(i1 %c) {
; CHECK-LABEL: 'f6'
; CHECK-NEXT: Classifying expressions for: @f6
; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0
; CHECK-NEXT: --> %start U: [0,128) S: [-128,128)
; 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: %loop.iv = phi i16 [ 0, %entry ], [ %loop.iv.inc, %loop ]
Expand All @@ -323,9 +323,9 @@ define void @f6(i1 %c) {
; CHECK-NEXT: %step.plus.one = add i32 %step, 1
; CHECK-NEXT: --> (1 + %step)<nuw><nsw> U: [1,0) S: [-1,3) Exits: (1 + %step)<nuw><nsw> LoopDispositions: { %loop: Invariant }
; CHECK-NEXT: %iv.next = add i32 %iv, %step.plus.one
; CHECK-NEXT: --> {(1 + %step + %start),+,(1 + %step)<nuw><nsw>}<%loop> U: [-256,384) S: [-256,384) Exits: (128 + (128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(1 + %step + %start),+,(1 + %step)<nuw><nsw>}<%loop> U: [-128,384) S: [-128,384) Exits: (128 + (128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.sext = sext i32 %iv to i64
; CHECK-NEXT: --> {(sext i32 %start to i64),+,(1 + (sext i32 %step to i64))<nuw><nsw>}<nsw><%loop> U: [0,128) S: [0,128) Exits: (127 + (sext i32 %start to i64) + (127 * (sext i32 %step to i64))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(zext i32 %start to i64),+,(1 + (sext i32 %step to i64))<nuw><nsw>}<nsw><%loop> U: [0,128) S: [0,128) Exits: (127 + (zext i32 %start to i64) + (127 * (sext i32 %step to i64))<nsw>) 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: @f6
Expand Down Expand Up @@ -359,7 +359,7 @@ define void @f7(i1 %c) {
; CHECK-LABEL: 'f7'
; CHECK-NEXT: Classifying expressions for: @f7
; CHECK-NEXT: %start = select i1 %c, i32 127, i32 0
; CHECK-NEXT: --> %start U: [0,128) S: [-128,128)
; CHECK-NEXT: --> %start U: [0,128) S: [0,128)
; CHECK-NEXT: %step = select i1 %c, i32 -1, i32 1
; CHECK-NEXT: --> %step U: [1,0) S: [-2,2)
; CHECK-NEXT: %loop.iv = phi i16 [ 0, %entry ], [ %loop.iv.inc, %loop ]
Expand All @@ -369,7 +369,7 @@ define void @f7(i1 %c) {
; 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))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.next = add i32 %iv, %step
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-384,256) S: [-384,256) Exits: ((128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: --> {(%step + %start),+,%step}<%loop> U: [-256,256) S: [-256,256) Exits: ((128 * %step)<nsw> + %start) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.trunc.plus.one = add i16 %iv.trunc, 1
; CHECK-NEXT: --> {(1 + (trunc i32 %start to i16))<nuw><nsw>,+,(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))<nsw>) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %iv.trunc.plus.two = add i16 %iv.trunc, 2
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Analysis/ScalarEvolution/max-be-count-not-constant.ll
Expand Up @@ -13,16 +13,16 @@ define void @pluto(i32 %arg) {
; CHECK-LABEL: 'pluto'
; CHECK-NEXT: Classifying expressions for: @pluto
; CHECK-NEXT: %tmp = ashr i32 %arg, 31
; CHECK-NEXT: --> %tmp U: full-set S: [-1,1)
; CHECK-NEXT: --> %tmp U: [-1,1) S: [-1,1)
; CHECK-NEXT: %tmp1 = add nsw i32 %tmp, 2
; CHECK-NEXT: --> (2 + %tmp)<nsw> U: [-2147483646,-2147483648) S: [1,3)
; CHECK-NEXT: --> (2 + %tmp)<nsw> U: [1,3) S: [1,3)
; CHECK-NEXT: %tmp3 = phi i32 [ 0, %bb ], [ %tmp4, %bb2 ]
; CHECK-NEXT: --> {0,+,(2 + %tmp)<nsw>}<nuw><nsw><%bb2> U: [0,5) S: [0,5) Exits: ((2 + %tmp)<nsw> * (1 /u (2 + %tmp)<nsw>)) LoopDispositions: { %bb2: Computable }
; CHECK-NEXT: --> {0,+,(2 + %tmp)<nsw>}<nuw><nsw><%bb2> U: [0,3) S: [0,3) Exits: ((2 + %tmp)<nsw> * (1 /u (2 + %tmp)<nsw>)) LoopDispositions: { %bb2: Computable }
; CHECK-NEXT: %tmp4 = add nuw nsw i32 %tmp1, %tmp3
; CHECK-NEXT: --> {(2 + %tmp)<nsw>,+,(2 + %tmp)<nsw>}<nuw><nsw><%bb2> U: [1,7) S: [1,7) Exits: (2 + ((2 + %tmp)<nsw> * (1 /u (2 + %tmp)<nsw>)) + %tmp) LoopDispositions: { %bb2: Computable }
; CHECK-NEXT: --> {(2 + %tmp)<nsw>,+,(2 + %tmp)<nsw>}<nuw><nsw><%bb2> U: [1,5) S: [1,5) Exits: (2 + ((2 + %tmp)<nsw> * (1 /u (2 + %tmp)<nsw>)) + %tmp) LoopDispositions: { %bb2: Computable }
; CHECK-NEXT: Determining loop execution counts for: @pluto
; CHECK-NEXT: Loop %bb2: backedge-taken count is (1 /u (2 + %tmp)<nsw>)
; CHECK-NEXT: Loop %bb2: max backedge-taken count is 2
; CHECK-NEXT: Loop %bb2: max backedge-taken count is 1
; CHECK-NEXT: Loop %bb2: Predicated backedge-taken count is (1 /u (2 + %tmp)<nsw>)
; CHECK-NEXT: Predicates:
; CHECK: Loop %bb2: Trip multiple is 1
Expand Down

0 comments on commit 4a5edea

Please sign in to comment.