diff options
author | Chris Jackson <chris.jackson@sony.com> | 2021-07-28 15:34:37 +0100 |
---|---|---|
committer | Chris Jackson <chris.jackson@sony.com> | 2021-07-28 16:28:46 +0100 |
commit | d675b594f4f1e1f6a195fb9a4fd02cf3de92292d (patch) | |
tree | e19293185a2d331ce1caed6b976f8c3baa041f5a /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | |
parent | 5b83261c1518a39636abe094123f1704bbfd972f (diff) | |
download | llvm-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.cpp | 5 |
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; } |