[llvm] 4cd6cc6 - [SCEV] Add test for propagating poison through select condition.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 13 09:15:05 PDT 2021
Author: Florian Hahn
Date: 2021-10-13T17:14:35+01:00
New Revision: 4cd6cc64edb3833327601fb9eb2b5a9b6fb2bb7f
URL: https://github.com/llvm/llvm-project/commit/4cd6cc64edb3833327601fb9eb2b5a9b6fb2bb7f
DIFF: https://github.com/llvm/llvm-project/commit/4cd6cc64edb3833327601fb9eb2b5a9b6fb2bb7f.diff
LOG: [SCEV] Add test for propagating poison through select condition.
Precommit a test for D111643.
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/nsw.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/nsw.ll b/llvm/test/Analysis/ScalarEvolution/nsw.ll
index 99bd34a2a9ea0..f1b2c8e9c7146 100644
--- a/llvm/test/Analysis/ScalarEvolution/nsw.ll
+++ b/llvm/test/Analysis/ScalarEvolution/nsw.ll
@@ -393,3 +393,39 @@ loop:
leave:
ret void
}
+
+define void @select_cond_poison_propagation(double* %p, i32 %x) nounwind {
+; 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}<nuw><nsw><%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %iv.next = add nsw i32 %iv, 1
+; CHECK-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %sel = select i1 %cmp, i32 10, i32 20
+; CHECK-NEXT: --> %sel U: [0,31) S: [0,31) Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: %cond = call i1 @cond()
+; CHECK-NEXT: --> %cond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: Determining loop execution counts for: @select_cond_poison_propagation
+; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count.
+; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
+;
+entry:
+ br label %loop
+
+loop:
+ %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ]
+ %iv.next = add nsw i32 %iv, 1
+ %cmp = icmp ult i32 %iv.next, %x
+ %sel = select i1 %cmp, i32 10, i32 20
+ call void @foo(i32 noundef %sel)
+ %cond = call i1 @cond()
+ br i1 %cond, label %loop, label %return
+
+return:
+ ret void
+}
+
+declare void @foo(i32)
+
+declare i1 @cond()
More information about the llvm-commits
mailing list