mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-05 11:17:53 +00:00
Use Instruction::moveBefore instead of manipulating the instruction list
directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52498 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1672,9 +1672,8 @@ static Instruction *AssociativeOpt(BinaryOperator &Root, const Functor &F) {
|
|||||||
}
|
}
|
||||||
Root.replaceAllUsesWith(TmpLHSI); // Users now use TmpLHSI
|
Root.replaceAllUsesWith(TmpLHSI); // Users now use TmpLHSI
|
||||||
TmpLHSI->setOperand(1, &Root); // TmpLHSI now uses the root
|
TmpLHSI->setOperand(1, &Root); // TmpLHSI now uses the root
|
||||||
TmpLHSI->getParent()->getInstList().remove(TmpLHSI);
|
|
||||||
BasicBlock::iterator ARI = &Root; ++ARI;
|
BasicBlock::iterator ARI = &Root; ++ARI;
|
||||||
BB->getInstList().insert(ARI, TmpLHSI); // Move TmpLHSI to after Root
|
TmpLHSI->moveBefore(ARI); // Move TmpLHSI to after Root
|
||||||
ARI = Root;
|
ARI = Root;
|
||||||
|
|
||||||
// Now propagate the ExtraOperand down the chain of instructions until we
|
// Now propagate the ExtraOperand down the chain of instructions until we
|
||||||
@@ -1683,8 +1682,7 @@ static Instruction *AssociativeOpt(BinaryOperator &Root, const Functor &F) {
|
|||||||
Instruction *NextLHSI = cast<Instruction>(TmpLHSI->getOperand(0));
|
Instruction *NextLHSI = cast<Instruction>(TmpLHSI->getOperand(0));
|
||||||
// Move the instruction to immediately before the chain we are
|
// Move the instruction to immediately before the chain we are
|
||||||
// constructing to avoid breaking dominance properties.
|
// constructing to avoid breaking dominance properties.
|
||||||
NextLHSI->getParent()->getInstList().remove(NextLHSI);
|
NextLHSI->moveBefore(ARI);
|
||||||
BB->getInstList().insert(ARI, NextLHSI);
|
|
||||||
ARI = NextLHSI;
|
ARI = NextLHSI;
|
||||||
|
|
||||||
Value *NextOp = NextLHSI->getOperand(1);
|
Value *NextOp = NextLHSI->getOperand(1);
|
||||||
|
Reference in New Issue
Block a user