[llvm] 4d97a91 - [SCEV] Use umin_seq for symbolic max BE count
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 06:32:57 PST 2022
Author: Nikita Popov
Date: 2022-12-07T15:32:49+01:00
New Revision: 4d97a914d7aef6c95cd95669f99e5d32899e165a
URL: https://github.com/llvm/llvm-project/commit/4d97a914d7aef6c95cd95669f99e5d32899e165a
DIFF: https://github.com/llvm/llvm-project/commit/4d97a914d7aef6c95cd95669f99e5d32899e165a.diff
LOG: [SCEV] Use umin_seq for symbolic max BE count
We were using umin_seq when computing the exact BE count, but not
when computing the symbolic max BE count.
Added:
Modified:
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/symbolic_max_exit_count.ll
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 53601a8f3e90..1d3071048956 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -14789,7 +14789,7 @@ ScalarEvolution::computeSymbolicMaxBackedgeTakenCount(const Loop *L) {
}
if (ExitCounts.empty())
return getCouldNotCompute();
- return getUMinFromMismatchedTypes(ExitCounts);
+ return getUMinFromMismatchedTypes(ExitCounts, /*Sequential*/ true);
}
/// A rewriter to replace SCEV expressions in Map with the corresponding entry
diff --git a/llvm/test/Analysis/ScalarEvolution/symbolic_max_exit_count.ll b/llvm/test/Analysis/ScalarEvolution/symbolic_max_exit_count.ll
index cb2af8d3967e..e63f7e45e8fc 100644
--- a/llvm/test/Analysis/ScalarEvolution/symbolic_max_exit_count.ll
+++ b/llvm/test/Analysis/ScalarEvolution/symbolic_max_exit_count.ll
@@ -412,7 +412,7 @@ define i32 @test_two_phis_simple(i32 %start_1, i32 %start_2, i32 %len) {
; CHECK-NEXT: exit count for loop: %start_1
; CHECK-NEXT: exit count for backedge: %start_2
; CHECK-NEXT: Loop %loop: constant max backedge-taken count is -1
-; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (%start_1 umin %start_2)
+; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (%start_1 umin_seq %start_2)
; CHECK-NEXT: symbolic max exit count for loop: %start_1
; CHECK-NEXT: symbolic max exit count for backedge: %start_2
; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (%start_1 umin_seq %start_2)
More information about the llvm-commits
mailing list