aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-10-05 20:53:43 +0000
committerJim Grosbach <grosbach@apple.com>2011-10-05 20:53:43 +0000
commit35d9da3d3b82cbf6ff9e788fb3200040a98dc155 (patch)
tree1723746d2357a822d7e83a862ed65bc77139a981 /lib/Transforms/InstCombine
parente2999b48998508ac426a9c2d67db55a6ca4b4fde (diff)
downloadexternal_llvm-35d9da3d3b82cbf6ff9e788fb3200040a98dc155.zip
external_llvm-35d9da3d3b82cbf6ff9e788fb3200040a98dc155.tar.gz
external_llvm-35d9da3d3b82cbf6ff9e788fb3200040a98dc155.tar.bz2
Re-commit 141203, but much more conservative.
Just pull the instruction name, but don't change the order of anything else. That keeps --debug happy and non-crashing, but doesn't change how the worklist gets built. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index cee27ff..c66f423 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -2017,13 +2017,13 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
// Everything uses the new instruction now.
I->replaceAllUsesWith(Result);
+ // Move the name to the new instruction first.
+ Result->takeName(I);
+
// Push the new instruction and any users onto the worklist.
Worklist.Add(Result);
Worklist.AddUsersToWorkList(*Result);
- // Move the name to the new instruction first.
- Result->takeName(I);
-
// Insert the new instruction into the basic block...
BasicBlock *InstParent = I->getParent();
BasicBlock::iterator InsertPos = I;