[llvm] 1fa0616 - [SCEV] Add more tests using info from loop guards for BTC.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 06:24:02 PDT 2020
Author: Florian Hahn
Date: 2020-09-25T14:18:58+01:00
New Revision: 1fa06162c1cf648a6d4fac837e02b709a205f4df
URL: https://github.com/llvm/llvm-project/commit/1fa06162c1cf648a6d4fac837e02b709a205f4df
DIFF: https://github.com/llvm/llvm-project/commit/1fa06162c1cf648a6d4fac837e02b709a205f4df.diff
LOG: [SCEV] Add more tests using info from loop guards for BTC.
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll b/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
index 7dc309477ba4..ccc27643f1c9 100644
--- a/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
+++ b/llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
@@ -25,6 +25,28 @@ exit:
ret void
}
+define void @test_guard_less_than_16_operands_swapped(i32* nocapture %a, i64 %i) {
+; CHECK-LABEL: Determining loop execution counts for: @test_guard_less_than_16_operands_swapped
+; CHECK-NEXT: Loop %loop: backedge-taken count is (15 + (-1 * %i))
+; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (15 + (-1 * %i))
+;
+entry:
+ %cmp3 = icmp ugt i64 16, %i
+ br i1 %cmp3, label %loop, label %exit
+
+loop:
+ %iv = phi i64 [ %iv.next, %loop ], [ %i, %entry ]
+ %idx = getelementptr inbounds i32, i32* %a, i64 %iv
+ store i32 1, i32* %idx, align 4
+ %iv.next = add nuw nsw i64 %iv, 1
+ %exitcond = icmp eq i64 %iv.next, 16
+ br i1 %exitcond, label %exit, label %loop
+
+exit:
+ ret void
+}
+
define void @test_guard_less_than_16_branches_flipped(i32* nocapture %a, i64 %i) {
; CHECK-LABEL: Determining loop execution counts for: @test_guard_less_than_16_branches_flipped
; CHECK-NEXT: Loop %loop: backedge-taken count is (15 + (-1 * %i))
@@ -69,6 +91,28 @@ exit:
ret void
}
+define void @test_guard_eq_12(i32* nocapture %a, i64 %N) {
+; CHECK-LABEL: Determining loop execution counts for: @test_guard_eq_12
+; CHECK-NEXT: Loop %loop: backedge-taken count is %N
+; CHECK-NEXT: Loop %loop: max backedge-taken count is -1
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is %N
+;
+entry:
+ %c.1 = icmp eq i64 %N, 12
+ br i1 %c.1, label %loop, label %exit
+
+loop:
+ %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ]
+ %idx = getelementptr inbounds i32, i32* %a, i64 %iv
+ store i32 1, i32* %idx, align 4
+ %iv.next = add nuw nsw i64 %iv, 1
+ %exitcond = icmp eq i64 %iv, %N
+ br i1 %exitcond, label %exit, label %loop
+
+exit:
+ ret void
+}
+
define void @test_multiple_const_guards_order1(i32* nocapture %a, i64 %i) {
; CHECK-LABEL: @test_multiple_const_guards_order1
; CHECK: Loop %loop: backedge-taken count is %i
More information about the llvm-commits
mailing list