[llvm] dbee36c - [SCEV] Add test for unnecessary umax in BECount (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 11 03:12:42 PST 2023
Author: Nikita Popov
Date: 2023-12-11T12:12:34+01:00
New Revision: dbee36c523dc3e04bb7d5d9cade392601b86fac4
URL: https://github.com/llvm/llvm-project/commit/dbee36c523dc3e04bb7d5d9cade392601b86fac4
DIFF: https://github.com/llvm/llvm-project/commit/dbee36c523dc3e04bb7d5d9cade392601b86fac4.diff
LOG: [SCEV] Add test for unnecessary umax in BECount (NFC)
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/trip-count.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count.ll b/llvm/test/Analysis/ScalarEvolution/trip-count.ll
index 5973d52d05ea6..22e49ebdbf4db 100644
--- a/llvm/test/Analysis/ScalarEvolution/trip-count.ll
+++ b/llvm/test/Analysis/ScalarEvolution/trip-count.ll
@@ -123,3 +123,28 @@ loop:
leave:
ret void
}
+
+define void @non_zero_from_loop_guard(i16 %n) {
+; CHECK-LABEL: 'non_zero_from_loop_guard'
+; CHECK-NEXT: Determining loop execution counts for: @non_zero_from_loop_guard
+; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (1 umax (%n /u 2)))<nsw>
+; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 32766
+; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (1 umax (%n /u 2)))<nsw>
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (1 umax (%n /u 2)))<nsw>
+; CHECK-NEXT: Predicates:
+; CHECK-NEXT: Loop %loop: Trip multiple is 1
+;
+entry:
+ %shr = lshr i16 %n, 1
+ %precond = icmp ult i16 %n, 2
+ br i1 %precond, label %exit, label %loop
+
+loop:
+ %iv = phi i16 [ %inc, %loop ], [ 0, %entry ]
+ %inc = add nuw nsw i16 %iv, 1
+ %cmp = icmp ult i16 %inc, %shr
+ br i1 %cmp, label %loop, label %exit
+
+exit:
+ ret void
+}
More information about the llvm-commits
mailing list