[llvm] e19d9ee - [SCEV] Add automated test checks for some tests
Joshua Cao via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 19 00:00:31 PST 2023
Author: Joshua Cao
Date: 2023-02-18T23:58:23-08:00
New Revision: e19d9eea6e36b752135574c3aca655cdc8f53540
URL: https://github.com/llvm/llvm-project/commit/e19d9eea6e36b752135574c3aca655cdc8f53540
DIFF: https://github.com/llvm/llvm-project/commit/e19d9eea6e36b752135574c3aca655cdc8f53540.diff
LOG: [SCEV] Add automated test checks for some tests
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/ZeroStep.ll
llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll
llvm/test/Analysis/ScalarEvolution/range-signedness.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll b/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll
index 227894edcdbad..51b8dd7e2b337 100644
--- a/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll
+++ b/llvm/test/Analysis/ScalarEvolution/ZeroStep.ll
@@ -1,13 +1,23 @@
-; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s -o - -S 2>&1 | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9.0"
; Test that SCEV is capable of figuring out value of 'IV' that actually does not change.
-; CHECK: Classifying expressions for: @foo
-; CHECK: %iv.i = phi i64
-; CHECK: -5 U: [-5,-4) S: [-5,-4) Exits: -5 LoopDispositions: { %loop: Invariant }
define void @foo() {
+; 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: %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: Determining loop execution counts for: @foo
+; CHECK-NEXT: Loop %loop: <multiple exits> Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
+;
entry:
br label %loop
diff --git a/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll b/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll
index aeb31c36f617c..6aaf55dba1022 100644
--- a/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll
+++ b/llvm/test/Analysis/ScalarEvolution/max-expr-cache.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; SCEV would take a long time to compute SCEV expressions for this IR. If SCEV
@@ -7,7 +8,96 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64--linux-gnu"
define void @smax(i32 %tmp3) {
- ; CHECK-LABEL: Printing analysis 'Scalar Evolution Analysis' for function 'smax'
+; CHECK-LABEL: 'smax'
+; CHECK-NEXT: Classifying expressions for: @smax
+; CHECK-NEXT: %tmp5 = phi i64 [ %tmp62, %bb61 ], [ 0, %entry ]
+; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%bb4> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: <<Unknown>> 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: <<Unknown>> 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: <<Unknown>> 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: <<Unknown>> 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: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp11 = add nsw i32 %tmp10, 1
+; CHECK-NEXT: --> (1 + (256 smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp13 = select i1 %tmp12, i32 %tmp11, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp16 = add nsw i32 %tmp15, 1
+; CHECK-NEXT: --> (1 + (256 smin (1 + (256 smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483647,258) S: [-2147483647,258) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,258) S: [-2147483648,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp44 = add nsw i32 %tmp10, 7
+; CHECK-NEXT: --> (7 + (256 smin {%tmp3,+,-256}<%bb4>))<nsw> U: [-2147483641,264) S: [-2147483641,264) Exits: <<Unknown>> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp48 = select i1 %tmp47, i32 %tmp44, i32 %tmp46
+; CHECK-NEXT: --> ((7 + (256 smin {%tmp3,+,-256}<%bb4>))<nsw> 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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>)) U: [-2147483641,264) S: [-2147483641,264) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp49 = ashr i32 %tmp48, 3
+; CHECK-NEXT: --> %tmp49 U: [-268435456,268435456) S: [-268435456,268435456) Exits: <<Unknown>> 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: <<Unknown>> LoopDispositions: { %bb4: Variant, %bb53: Invariant }
+; CHECK-NEXT: %tmp52 = zext i32 %tmp51 to i64
+; CHECK-NEXT: --> (zext i32 (0 smax %tmp49) to i64) U: [0,268435456) S: [0,268435456) Exits: <<Unknown>> LoopDispositions: { %bb4: Variant, %bb53: Invariant }
+; CHECK-NEXT: %tmp54 = phi i64 [ undef, %bb4 ], [ %tmp59, %bb53 ]
+; CHECK-NEXT: --> {undef,+,1}<nsw><%bb53> U: full-set S: full-set Exits: (-1 + (zext i32 (0 smax %tmp49) to i64))<nsw> LoopDispositions: { %bb53: Computable, %bb4: Variant }
+; 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))<nsw> 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))<nuw><nsw>)<nsw> 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))<nuw><nsw>)<nsw> 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))<nuw><nsw> + null) LoopDispositions: { %bb53: Computable, %bb4: Variant }
+; CHECK-NEXT: %tmp59 = add nsw i64 %tmp54, 1
+; CHECK-NEXT: --> {(1 + undef),+,1}<nsw><%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
+; CHECK-NEXT: --> {1,+,1}<nuw><%bb4> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: Determining loop execution counts for: @smax
+; CHECK-NEXT: Loop %bb53: backedge-taken count is (-1 + (zext i32 (0 smax %tmp49) to i64) + (-1 * undef))
+; CHECK-NEXT: Loop %bb53: constant max backedge-taken count is -1
+; CHECK-NEXT: Loop %bb53: symbolic max backedge-taken count is (-1 + (zext i32 (0 smax %tmp49) to i64) + (-1 * undef))
+; CHECK-NEXT: Loop %bb53: Predicated backedge-taken count is (-1 + (zext i32 (0 smax %tmp49) to i64) + (-1 * undef))
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %bb53: Trip multiple is 1
+; CHECK-NEXT: Loop %bb4: <multiple exits> Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %bb4: Unpredictable constant max backedge-taken count.
+; CHECK-NEXT: Loop %bb4: Unpredictable symbolic max backedge-taken count.
+; CHECK-NEXT: Loop %bb4: Unpredictable predicated backedge-taken count.
+;
entry:
br label %bb4
@@ -54,8 +144,6 @@ bb4:
%tmp44 = add nsw i32 %tmp10, 7
%tmp45 = icmp slt i32 %tmp43, 256
%tmp46 = select i1 %tmp45, i32 %tmp43, i32 256
-; CHECK: %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>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>))<nsw> smin {%tmp3,+,-256}<%bb4>) U: [-2147483648,257) S: [-2147483648,257)
%tmp47 = icmp sgt i32 %tmp44, %tmp46
%tmp48 = select i1 %tmp47, i32 %tmp44, i32 %tmp46
%tmp49 = ashr i32 %tmp48, 3
@@ -82,7 +170,96 @@ bb61:
define void @umax(i32 %tmp3) {
-; CHECK-LABEL: Printing analysis 'Scalar Evolution Analysis' for function 'umax'
+; CHECK-LABEL: 'umax'
+; CHECK-NEXT: Classifying expressions for: @umax
+; CHECK-NEXT: %tmp5 = phi i64 [ %tmp62, %bb61 ], [ 0, %entry ]
+; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%bb4> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: <<Unknown>> 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: <<Unknown>> 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: <<Unknown>> 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: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp10 = select i1 %tmp9, i32 %tmp8, i32 256
+; CHECK-NEXT: --> (256 umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp11 = add nsw i32 %tmp10, 1
+; CHECK-NEXT: --> (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp13 = select i1 %tmp12, i32 %tmp11, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp15 = select i1 %tmp14, i32 %tmp13, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp16 = add nsw i32 %tmp15, 1
+; CHECK-NEXT: --> (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp18 = select i1 %tmp17, i32 %tmp16, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp20 = select i1 %tmp19, i32 %tmp18, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp21 = add nsw i32 %tmp20, 1
+; CHECK-NEXT: --> (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp23 = select i1 %tmp22, i32 %tmp21, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp25 = select i1 %tmp24, i32 %tmp23, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp26 = add nsw i32 %tmp25, 1
+; CHECK-NEXT: --> (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp28 = select i1 %tmp27, i32 %tmp26, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp30 = select i1 %tmp29, i32 %tmp28, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp31 = add nsw i32 %tmp30, 1
+; CHECK-NEXT: --> (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp33 = select i1 %tmp32, i32 %tmp31, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp35 = select i1 %tmp34, i32 %tmp33, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp36 = add nsw i32 %tmp35, 1
+; CHECK-NEXT: --> (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp38 = select i1 %tmp37, i32 %tmp36, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp40 = select i1 %tmp39, i32 %tmp38, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp41 = add nsw i32 %tmp40, 1
+; CHECK-NEXT: --> (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [1,258) S: [1,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp43 = select i1 %tmp42, i32 %tmp41, i32 %tmp8
+; CHECK-NEXT: --> ((1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,258) S: [0,258) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp44 = add nsw i32 %tmp10, 7
+; CHECK-NEXT: --> (7 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> U: [7,264) S: [7,264) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp46 = select i1 %tmp45, i32 %tmp43, i32 256
+; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp48 = select i1 %tmp47, i32 %tmp44, i32 %tmp46
+; CHECK-NEXT: --> ((7 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umax (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>)) U: [7,264) S: [7,264) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: %tmp49 = ashr i32 %tmp48, 3
+; CHECK-NEXT: --> %tmp49 U: [0,128) S: [0,128) Exits: <<Unknown>> LoopDispositions: { %bb4: Variant, %bb53: Invariant }
+; CHECK-NEXT: %tmp51 = select i1 %tmp50, i32 %tmp49, i32 0
+; CHECK-NEXT: --> %tmp49 U: [0,128) S: [0,128) Exits: <<Unknown>> LoopDispositions: { %bb4: Variant, %bb53: Invariant }
+; CHECK-NEXT: %tmp52 = zext i32 %tmp51 to i64
+; CHECK-NEXT: --> (zext i32 %tmp49 to i64) U: [0,128) S: [0,128) Exits: <<Unknown>> LoopDispositions: { %bb4: Variant, %bb53: Invariant }
+; CHECK-NEXT: %tmp54 = phi i64 [ undef, %bb4 ], [ %tmp59, %bb53 ]
+; CHECK-NEXT: --> {undef,+,1}<nsw><%bb53> U: full-set S: full-set Exits: (-1 + (zext i32 %tmp49 to i64))<nsw> LoopDispositions: { %bb53: Computable, %bb4: Variant }
+; 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)<nsw> 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)<nuw><nsw>)<nsw> 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))<nuw><nsw>)<nsw> 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))<nuw><nsw> + null) LoopDispositions: { %bb53: Computable, %bb4: Variant }
+; CHECK-NEXT: %tmp59 = add nsw i64 %tmp54, 1
+; CHECK-NEXT: --> {(1 + undef),+,1}<nsw><%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
+; CHECK-NEXT: --> {1,+,1}<nuw><%bb4> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %bb4: Computable, %bb53: Invariant }
+; CHECK-NEXT: Determining loop execution counts for: @umax
+; CHECK-NEXT: Loop %bb53: backedge-taken count is (-1 + (zext i32 %tmp49 to i64) + (-1 * undef))
+; CHECK-NEXT: Loop %bb53: constant max backedge-taken count is -1
+; CHECK-NEXT: Loop %bb53: symbolic max backedge-taken count is (-1 + (zext i32 %tmp49 to i64) + (-1 * undef))
+; CHECK-NEXT: Loop %bb53: Predicated backedge-taken count is (-1 + (zext i32 %tmp49 to i64) + (-1 * undef))
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %bb53: Trip multiple is 1
+; CHECK-NEXT: Loop %bb4: <multiple exits> Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %bb4: Unpredictable constant max backedge-taken count.
+; CHECK-NEXT: Loop %bb4: Unpredictable symbolic max backedge-taken count.
+; CHECK-NEXT: Loop %bb4: Unpredictable predicated backedge-taken count.
+;
entry:
br label %bb4
@@ -129,8 +306,6 @@ bb4:
%tmp44 = add nsw i32 %tmp10, 7
%tmp45 = icmp ult i32 %tmp43, 256
%tmp46 = select i1 %tmp45, i32 %tmp43, i32 256
-; CHECK: %tmp46 = select i1 %tmp45, i32 %tmp43, i32 256
-; CHECK-NEXT: --> (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin (1 + (256 umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>))<nuw><nsw> umin {%tmp3,+,-256}<%bb4>) U: [0,257) S: [0,257)
%tmp47 = icmp ugt i32 %tmp44, %tmp46
%tmp48 = select i1 %tmp47, i32 %tmp44, i32 %tmp46
%tmp49 = ashr i32 %tmp48, 3
diff --git a/llvm/test/Analysis/ScalarEvolution/range-signedness.ll b/llvm/test/Analysis/ScalarEvolution/range-signedness.ll
index 452e880e2ae85..43c62338f175a 100644
--- a/llvm/test/Analysis/ScalarEvolution/range-signedness.ll
+++ b/llvm/test/Analysis/ScalarEvolution/range-signedness.ll
@@ -1,39 +1,62 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
define void @x(ptr %cond) {
-; CHECK-LABEL: Classifying expressions for: @x
- entry:
+; CHECK-LABEL: 'x'
+; CHECK-NEXT: Classifying expressions for: @x
+; CHECK-NEXT: %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
+; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-128) S: [0,-128) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %idx.inc = add nsw i8 %idx, 1
+; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %c = load volatile i1, ptr %cond, align 1
+; CHECK-NEXT: --> %c U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: Determining loop execution counts for: @x
+; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable constant max backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable symbolic max backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
+;
+ entry:
br label %loop
- loop:
+ loop:
%idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
-; CHECK: %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
-; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-128) S: [0,-128)
%idx.inc = add nsw i8 %idx, 1
%c = load volatile i1, ptr %cond
br i1 %c, label %loop, label %exit
- exit:
+ exit:
ret void
}
define void @y(ptr %addr) {
-; CHECK-LABEL: Classifying expressions for: @y
- entry:
+; 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: %idx.inc = add i8 %idx, 1
+; CHECK-NEXT: --> {-4,+,1}<%loop> U: [-4,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
+; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is 10
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is 10
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %loop: Trip multiple is 11
+;
+ entry:
br label %loop
- loop:
+ loop:
%idx = phi i8 [-5, %entry ], [ %idx.inc, %loop ]
-; CHECK: %idx = phi i8 [ -5, %entry ], [ %idx.inc, %loop ]
-; CHECK-NEXT: --> {-5,+,1}<%loop> U: [-5,6) S: [-5,6)
%idx.inc = add i8 %idx, 1
%continue = icmp slt i8 %idx.inc, 6
br i1 %continue, label %loop, label %exit
- exit:
+ exit:
ret void
}
More information about the llvm-commits
mailing list