[llvm] 2f64a6c - [SCEV] Add additional poison implication tests (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 06:23:49 PDT 2022
Author: Nikita Popov
Date: 2022-05-04T15:23:39+02:00
New Revision: 2f64a6cf9ca74dd00070adab4a6d0f07ecb25ee1
URL: https://github.com/llvm/llvm-project/commit/2f64a6cf9ca74dd00070adab4a6d0f07ecb25ee1
DIFF: https://github.com/llvm/llvm-project/commit/2f64a6cf9ca74dd00070adab4a6d0f07ecb25ee1.diff
LOG: [SCEV] Add additional poison implication tests (NFC)
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll b/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll
index 6142cdf148f56..56d3a8cbf04a1 100644
--- a/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll
+++ b/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll
@@ -733,23 +733,23 @@ exit:
ret i32 %i
}
-define i32 @logical_and_implies_poison_complex(i32 %n, i32 %m) {
-; CHECK-LABEL: 'logical_and_implies_poison_complex'
-; CHECK-NEXT: Classifying expressions for: @logical_and_implies_poison_complex
+define i32 @logical_and_implies_poison_complex1(i32 %n, i32 %m) {
+; CHECK-LABEL: 'logical_and_implies_poison_complex1'
+; CHECK-NEXT: Classifying expressions for: @logical_and_implies_poison_complex1
; CHECK-NEXT: %add = add i32 %n, %m
; CHECK-NEXT: --> (%n + %m) U: full-set S: full-set
; CHECK-NEXT: %add1 = add i32 %add, 1
; CHECK-NEXT: --> (1 + %n + %m) U: full-set S: full-set
; CHECK-NEXT: %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
-; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: ((%n + %m) umin_seq (1 + %n + %m)) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: ((1 + %n + %m) umin_seq (%n + %m)) LoopDispositions: { %loop: Computable }
; CHECK-NEXT: %i.next = add i32 %i, 1
-; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + ((%n + %m) umin_seq (1 + %n + %m))) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + ((1 + %n + %m) umin_seq (%n + %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: <<Unknown>> LoopDispositions: { %loop: Variant }
-; CHECK-NEXT: Determining loop execution counts for: @logical_and_implies_poison_complex
-; CHECK-NEXT: Loop %loop: backedge-taken count is ((%n + %m) umin_seq (1 + %n + %m))
+; CHECK-NEXT: Determining loop execution counts for: @logical_and_implies_poison_complex1
+; CHECK-NEXT: Loop %loop: backedge-taken count is ((1 + %n + %m) umin_seq (%n + %m))
; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
-; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((%n + %m) umin_seq (1 + %n + %m))
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((1 + %n + %m) umin_seq (%n + %m))
; CHECK-NEXT: Predicates:
; CHECK: Loop %loop: Trip multiple is 1
;
@@ -757,6 +757,76 @@ entry:
%add = add i32 %n, %m
%add1 = add i32 %add, 1
br label %loop
+loop:
+ %i = phi i32 [0, %entry], [%i.next, %loop]
+ %i.next = add i32 %i, 1
+ %cond_p0 = icmp ult i32 %i, %add1
+ %cond_p1 = icmp ult i32 %i, %add
+ %cond = select i1 %cond_p0, i1 %cond_p1, i1 false
+ br i1 %cond, label %loop, label %exit
+exit:
+ ret i32 %i
+}
+
+define i32 @logical_and_implies_poison_complex2(i32 %n, i32 %m, i32 %l) {
+; CHECK-LABEL: 'logical_and_implies_poison_complex2'
+; CHECK-NEXT: Classifying expressions for: @logical_and_implies_poison_complex2
+; CHECK-NEXT: %add = add i32 %n, %m
+; CHECK-NEXT: --> (%n + %m) U: full-set S: full-set
+; CHECK-NEXT: %add1 = add i32 %add, %l
+; CHECK-NEXT: --> (%n + %m + %l) U: full-set S: full-set
+; CHECK-NEXT: %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
+; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: ((%n + %m + %l) umin_seq (%n + %m)) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %i.next = add i32 %i, 1
+; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + ((%n + %m + %l) umin_seq (%n + %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: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: Determining loop execution counts for: @logical_and_implies_poison_complex2
+; CHECK-NEXT: Loop %loop: backedge-taken count is ((%n + %m + %l) umin_seq (%n + %m))
+; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((%n + %m + %l) umin_seq (%n + %m))
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %loop: Trip multiple is 1
+;
+entry:
+ %add = add i32 %n, %m
+ %add1 = add i32 %add, %l
+ br label %loop
+loop:
+ %i = phi i32 [0, %entry], [%i.next, %loop]
+ %i.next = add i32 %i, 1
+ %cond_p0 = icmp ult i32 %i, %add1
+ %cond_p1 = icmp ult i32 %i, %add
+ %cond = select i1 %cond_p0, i1 %cond_p1, i1 false
+ br i1 %cond, label %loop, label %exit
+exit:
+ ret i32 %i
+}
+
+define i32 @logical_and_implies_poison_complex_wrong_direction(i32 %n, i32 %m, i32 %l) {
+; CHECK-LABEL: 'logical_and_implies_poison_complex_wrong_direction'
+; CHECK-NEXT: Classifying expressions for: @logical_and_implies_poison_complex_wrong_direction
+; CHECK-NEXT: %add = add i32 %n, %m
+; CHECK-NEXT: --> (%n + %m) U: full-set S: full-set
+; CHECK-NEXT: %add1 = add i32 %add, %l
+; CHECK-NEXT: --> (%n + %m + %l) U: full-set S: full-set
+; CHECK-NEXT: %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
+; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: ((%n + %m) umin_seq (%n + %m + %l)) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %i.next = add i32 %i, 1
+; CHECK-NEXT: --> {1,+,1}<%loop> U: full-set S: full-set Exits: (1 + ((%n + %m) umin_seq (%n + %m + %l))) 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: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: Determining loop execution counts for: @logical_and_implies_poison_complex_wrong_direction
+; CHECK-NEXT: Loop %loop: backedge-taken count is ((%n + %m) umin_seq (%n + %m + %l))
+; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((%n + %m) umin_seq (%n + %m + %l))
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %loop: Trip multiple is 1
+;
+entry:
+ %add = add i32 %n, %m
+ %add1 = add i32 %add, %l
+ br label %loop
loop:
%i = phi i32 [0, %entry], [%i.next, %loop]
%i.next = add i32 %i, 1
More information about the llvm-commits
mailing list