Skip to content

Commit 796b84d

Browse files
author
Chris Jackson
committed
[DebugInfo][LoopStrengthReduction] SCEV-based salvaging for LSR
This reapplies commit 76f3ffb that was reverted due to buildbot failures. - Update lit tests with REQUIRES condition. - Abandon salvage attempt if SCEVUnknown::getValue() returns nullptr. Differential Revision: https://reviews.llvm.org/D105207
1 parent 259e365 commit 796b84d

File tree

10 files changed

+947
-83
lines changed

10 files changed

+947
-83
lines changed

llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
8383
/// InsertedValues/InsertedPostIncValues.
8484
SmallPtrSet<Value *, 16> ReusedValues;
8585

86+
// The induction variables generated.
87+
SmallVector<WeakVH, 2> InsertedIVs;
88+
8689
/// A memoization of the "relevant" loop for a given SCEV.
8790
DenseMap<const SCEV *, const Loop *> RelevantLoops;
8891

@@ -199,9 +202,11 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
199202
InsertedPostIncValues.clear();
200203
ReusedValues.clear();
201204
ChainedPhis.clear();
205+
InsertedIVs.clear();
202206
}
203207

204208
ScalarEvolution *getSE() { return &SE; }
209+
const SmallVectorImpl<WeakVH> &getInsertedIVs() const { return InsertedIVs; }
205210

206211
/// Return a vector containing all instructions inserted during expansion.
207212
SmallVector<Instruction *, 32> getAllInsertedInstructions() const {

0 commit comments

Comments
 (0)