forked from OSchip/llvm-project
Revert 141203. InstCombine is looping on unit tests.
llvm-svn: 141209
This commit is contained in:
parent
533920650b
commit
8f9acfac89
|
@ -2009,18 +2009,21 @@ 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.
|
||||
// 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);
|
||||
|
||||
DEBUG(errs() << "IC: Old = " << *I << '\n'
|
||||
<< " New = " << *Result << '\n');
|
||||
|
||||
|
||||
// Insert the new instruction into the basic block...
|
||||
BasicBlock *InstParent = I->getParent();
|
||||
BasicBlock::iterator InsertPos = I;
|
||||
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue