diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-10-05 20:44:29 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-10-05 20:44:29 +0000 |
commit | 8f9acfac898bc6667eaba6564d2a1b583d902c50 (patch) | |
tree | fc9aaf331184b8e03c465eff65204d7201636191 | |
parent | 533920650bea00b87eae5aed4742391fa1c26a2d (diff) | |
download | bcm5719-llvm-8f9acfac898bc6667eaba6564d2a1b583d902c50.tar.gz bcm5719-llvm-8f9acfac898bc6667eaba6564d2a1b583d902c50.zip |
Revert 141203. InstCombine is looping on unit tests.
llvm-svn: 141209
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 17 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll | 4 |
2 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index a302a46290e..cee27ff5913 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -2009,17 +2009,20 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) { ++NumCombined; // Should we replace the old instruction with a new one? if (Result != I) { + DEBUG(errs() << "IC: Old = " << *I << '\n' + << " New = " << *Result << '\n'); + if (!I->getDebugLoc().isUnknown()) Result->setDebugLoc(I->getDebugLoc()); // Everything uses the new instruction now. I->replaceAllUsesWith(Result); - // Move the name to the new instruction. - Result->takeName(I); - - DEBUG(errs() << "IC: Old = " << *I << '\n' - << " New = " << *Result << '\n'); + // 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(); @@ -2032,10 +2035,6 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) { InstParent->getInstList().insert(InsertPos, Result); EraseInstFromFunction(*I); - - // Push the new instruction and any users onto the worklist. - Worklist.Add(Result); - Worklist.AddUsersToWorkList(*Result); } else { #ifndef NDEBUG DEBUG(errs() << "IC: Mod = " << OrigI << '\n' diff --git a/llvm/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll b/llvm/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll index a2590b4eb85..441d5f9b0b6 100644 --- a/llvm/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll +++ b/llvm/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll @@ -5,8 +5,8 @@ define i32 @main(i32 %argc) nounwind ssp { entry: %tmp3151 = trunc i32 %argc to i8 -; CHECK: %0 = shl i8 %tmp3151, 5 -; CHECK: and i8 %0, 64 +; CHECK: %tmp3162 = shl i8 %tmp3151, 5 +; CHECK: and i8 %tmp3162, 64 ; CHECK-NOT: shl ; CHECK-NOT: shr %tmp3161 = or i8 %tmp3151, -17 |