Skip to content

Commit

Permalink
Revert "[LCSSA] Don't invalidate SCEV"
Browse files Browse the repository at this point in the history
This reverts commit 5cbb9f7.

Causes verifier error reported at
https://reviews.llvm.org/D149331#4387931.
  • Loading branch information
nikic committed Jun 5, 2023
1 parent 26fee2b commit 3c9cf02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/Transforms/Utils/LCSSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static bool isExitBlock(BasicBlock *BB,
/// rewrite the uses.
bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
const DominatorTree &DT, const LoopInfo &LI,
ScalarEvolution *Se,
ScalarEvolution *SE,
SmallVectorImpl<PHINode *> *PHIsToRemove,
SmallVectorImpl<PHINode *> *InsertedPHIs) {
SmallVector<Use *, 16> UsesToRewrite;
Expand Down Expand Up @@ -148,6 +148,11 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
SSAUpdater SSAUpdate(&LocalInsertedPHIs);
SSAUpdate.Initialize(I->getType(), I->getName());

// Force re-computation of I, as some users now need to use the new PHI
// node.
if (SE)
SE->forgetValue(I);

// Insert the LCSSA phi's into all of the exit blocks dominated by the
// value, and add them to the Phi's map.
for (BasicBlock *ExitBB : ExitBlocks) {
Expand Down

0 comments on commit 3c9cf02

Please sign in to comment.