[llvm-commits] [llvm] r141209 - in /llvm/trunk: lib/Transforms/InstCombine/InstructionCombining.cpp test/Transforms/InstCombine/2010-11-01-lshr-mask.ll
Jim Grosbach
grosbach at apple.com
Wed Oct 5 13:44:30 PDT 2011
Author: grosbach
Date: Wed Oct 5 15:44:29 2011
New Revision: 141209
URL: http://llvm.org/viewvc/llvm-project?rev=141209&view=rev
Log:
Revert 141203. InstCombine is looping on unit tests.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/trunk/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll
Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=141209&r1=141208&r2=141209&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Wed Oct 5 15:44:29 2011
@@ -2009,17 +2009,20 @@
++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 @@
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'
Modified: llvm/trunk/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll?rev=141209&r1=141208&r2=141209&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll Wed Oct 5 15:44:29 2011
@@ -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
More information about the llvm-commits
mailing list