aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2023-07-05 18:11:39 +0100
committerFlorian Hahn <flo@fhahn.com>2023-07-05 18:11:44 +0100
commit69ca5c9d62deef66a00ceb26706fab7c755d1f10 (patch)
tree4942fb2e1d85c525da29abdd0bfedf55b0946698 /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
parent68f5d1be3d8f9b2ee2f25098203b24a32057b4e6 (diff)
downloadllvm-69ca5c9d62deef66a00ceb26706fab7c755d1f10.zip
llvm-69ca5c9d62deef66a00ceb26706fab7c755d1f10.tar.gz
llvm-69ca5c9d62deef66a00ceb26706fab7c755d1f10.tar.bz2
[SCEV] Add flag to control invertible check for normalization.
When normalizing a SCEV expression during expansion, there should be no need for it to be invertible, as it will only be used for code generation. This fixes a crash after 7f5b15ad150e. Fixes https://github.com/llvm/llvm-project/issues/63678.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index ab6cb29..6200b4d 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -1392,7 +1392,8 @@ Value *SCEVExpander::expandAddRecExprLiterally(const SCEVAddRecExpr *S) {
if (PostIncLoops.count(L)) {
PostIncLoopSet Loops;
Loops.insert(L);
- Normalized = cast<SCEVAddRecExpr>(normalizeForPostIncUse(S, Loops, SE));
+ Normalized = cast<SCEVAddRecExpr>(
+ normalizeForPostIncUse(S, Loops, SE, /*CheckInvertible=*/false));
}
// Strip off any non-loop-dominating component from the addrec start.