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 d675b59 that was
reverted due to buildbot failures. A simple fix has been applied to
remove an assertion.

Differential Revision: https://reviews.llvm.org/D105207
  • Loading branch information
Chris Jackson committed Jul 28, 2021
1 parent 43a44f1 commit 0ba8595
Showing 10 changed files with 949 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
@@ -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;

@@ -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 {
Loading

0 comments on commit 0ba8595

Please sign in to comment.