diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-19 17:47:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-19 17:47:47 +0000 |
commit | 0bb9a3dc0881d28a646b6a1d29c66db34bbbe12a (patch) | |
tree | 1a52d85deeea3e1cc393886f72b31db28104c745 /lib | |
parent | 7ae66b909b51560382a25b22927f2645e7e44b94 (diff) | |
download | external_llvm-0bb9a3dc0881d28a646b6a1d29c66db34bbbe12a.zip external_llvm-0bb9a3dc0881d28a646b6a1d29c66db34bbbe12a.tar.gz external_llvm-0bb9a3dc0881d28a646b6a1d29c66db34bbbe12a.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4409380..481f397 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1672,9 +1672,8 @@ static Instruction *AssociativeOpt(BinaryOperator &Root, const Functor &F) { } Root.replaceAllUsesWith(TmpLHSI); // Users now use TmpLHSI TmpLHSI->setOperand(1, &Root); // TmpLHSI now uses the root - TmpLHSI->getParent()->getInstList().remove(TmpLHSI); 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; // 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)); // Move the instruction to immediately before the chain we are // constructing to avoid breaking dominance properties. - NextLHSI->getParent()->getInstList().remove(NextLHSI); - BB->getInstList().insert(ARI, NextLHSI); + NextLHSI->moveBefore(ARI); ARI = NextLHSI; Value *NextOp = NextLHSI->getOperand(1); |