Skip to content

Commit

Permalink
[DebugInfo][LoopStrengthReduction] SCEV-based salvaging for LSR
Browse files Browse the repository at this point in the history
Reapply commit 796b84d 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
  • Loading branch information
Chris Jackson committed Jul 28, 2021
1 parent 5b83261 commit d675b59
Show file tree
Hide file tree
Showing 10 changed files with 950 additions and 83 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
/// InsertedValues/InsertedPostIncValues.
SmallPtrSet<Value *, 16> ReusedValues;

// The induction variables generated.
SmallVector<WeakVH, 2> InsertedIVs;

/// A memoization of the "relevant" loop for a given SCEV.
DenseMap<const SCEV *, const Loop *> RelevantLoops;

Expand Down Expand Up @@ -199,9 +202,11 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
InsertedPostIncValues.clear();
ReusedValues.clear();
ChainedPhis.clear();
InsertedIVs.clear();
}

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

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

0 comments on commit d675b59

Please sign in to comment.