diff options
author | Florian Hahn <flo@fhahn.com> | 2024-06-04 22:23:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 22:23:30 +0100 |
commit | e949b54a5b7cd7cd0690fa126be3363a21f05a8e (patch) | |
tree | 87e9a482462eafb372daa6a161a829f24d57b88e /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | |
parent | afe6ab7586f7078cc410f6162bd9851e48e2a286 (diff) | |
download | llvm-e949b54a5b7cd7cd0690fa126be3363a21f05a8e.zip llvm-e949b54a5b7cd7cd0690fa126be3363a21f05a8e.tar.gz llvm-e949b54a5b7cd7cd0690fa126be3363a21f05a8e.tar.bz2 |
[LAA] Use PSE::getSymbolicMaxBackedgeTakenCount. (#93499)
Update LAA to use PSE::getSymbolicMaxBackedgeTakenCount which returns
the minimum of the countable exits.
When analyzing dependences and computing runtime checks, we need the
smallest upper bound on the number of iterations. In terms of memory
safety, it shouldn't matter if any uncomputable exits leave the loop,
as long as we prove that there are no dependences given the minimum of
the countable exits. The same should apply also for generating runtime
checks.
Note that this shifts the responsiblity of checking whether all exit
counts are computable or handling early-exits to the users of LAA.
Depends on https://github.com/llvm/llvm-project/pull/93498
PR: https://github.com/llvm/llvm-project/pull/93499
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp index 0feea0a..c437a44 100644 --- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp @@ -2079,7 +2079,7 @@ Value *SCEVExpander::generateOverflowCheck(const SCEVAddRecExpr *AR, // FIXME: It is highly suspicious that we're ignoring the predicates here. SmallVector<const SCEVPredicate *, 4> Pred; const SCEV *ExitCount = - SE.getPredicatedBackedgeTakenCount(AR->getLoop(), Pred); + SE.getPredicatedSymbolicMaxBackedgeTakenCount(AR->getLoop(), Pred); assert(!isa<SCEVCouldNotCompute>(ExitCount) && "Invalid loop count"); |