[llvm] 535c2da - [SCEV] Add range test with phi and division.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 21 11:59:00 PST 2022
Author: Florian Hahn
Date: 2022-11-21T19:58:43Z
New Revision: 535c2da58dd2469dc8b8610443b51e5b10867074
URL: https://github.com/llvm/llvm-project/commit/535c2da58dd2469dc8b8610443b51e5b10867074
DIFF: https://github.com/llvm/llvm-project/commit/535c2da58dd2469dc8b8610443b51e5b10867074.diff
LOG: [SCEV] Add range test with phi and division.
Extra test coverage for D130728.
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/ranges.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/ranges.ll b/llvm/test/Analysis/ScalarEvolution/ranges.ll
index 00480a28ff722..f5583d091f148 100644
--- a/llvm/test/Analysis/ScalarEvolution/ranges.ll
+++ b/llvm/test/Analysis/ScalarEvolution/ranges.ll
@@ -103,3 +103,24 @@ define i64 @zext(i8 %a) {
call void @llvm.assume(i1 %pos)
ret i64 %res
}
+
+define i32 @phi_div() {
+; CHECK-LABEL: 'phi_div'
+; CHECK-NEXT: Classifying expressions for: @phi_div
+; CHECK-NEXT: %range.1 = phi i32 [ 0, %entry ], [ %shr, %loop ]
+; CHECK-NEXT: --> %range.1 U: [0,1) S: [0,1) Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: %shr = lshr i32 %range.1, 1
+; CHECK-NEXT: --> (%range.1 /u 2) U: [0,1) S: [0,1) Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
+; CHECK-NEXT: Determining loop execution counts for: @phi_div
+; CHECK-NEXT: Loop %loop: <multiple exits> 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:
+ %range.1 = phi i32 [ 0, %entry ], [ %shr, %loop ]
+ %shr = lshr i32 %range.1, 1
+ br label %loop
+}
More information about the llvm-commits
mailing list