aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorChris Jackson <chris.jackson@sony.com>2021-07-28 15:34:37 +0100
committerChris Jackson <chris.jackson@sony.com>2021-07-28 16:28:46 +0100
commitd675b594f4f1e1f6a195fb9a4fd02cf3de92292d (patch)
treee19293185a2d331ce1caed6b976f8c3baa041f5a /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
parent5b83261c1518a39636abe094123f1704bbfd972f (diff)
downloadllvm-d675b594f4f1e1f6a195fb9a4fd02cf3de92292d.zip
llvm-d675b594f4f1e1f6a195fb9a4fd02cf3de92292d.tar.gz
llvm-d675b594f4f1e1f6a195fb9a4fd02cf3de92292d.tar.bz2
[DebugInfo][LoopStrengthReduction] SCEV-based salvaging for LSR
Reapply commit 796b84d26f4d461fb50e7b4e84e15a10eaca88fc that was reverted due to reports of crashes. A minor change now guards against getVariableLocationOperand() returning a nullptr. Differential Revision: https://reviews.llvm.org/D106659
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index 5af1c37..3978e1e 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -1393,9 +1393,10 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized,
// can ensure that IVIncrement dominates the current uses.
PostIncLoops = SavedPostIncLoops;
- // Remember this PHI, even in post-inc mode.
+ // Remember this PHI, even in post-inc mode. LSR SCEV-based salvaging is most
+ // effective when we are able to use an IV inserted here, so record it.
InsertedValues.insert(PN);
-
+ InsertedIVs.push_back(PN);
return PN;
}