[X86] Erase dead LEA instruction after converting it to MOV in FixupLEAPass::processInstrForSlow3OpLEA.

This commit is contained in:
Craig Topper 2019-12-11 07:51:02 -08:00
parent 72c68f1352
commit 3adc819b7a
3 changed files with 3 additions and 2 deletions

View File

@ -650,6 +650,9 @@ void FixupLEAPass::processInstrForSlow3OpLEA(MachineBasicBlock::iterator &I,
.addReg(DestReg)
.add(Index);
LLVM_DEBUG(NewMI->dump(););
MBB.erase(I);
I = NewMI;
return;
}

View File

@ -378,7 +378,6 @@ body: |
; CHECK: liveins: $eax, $ebp, $ebx
; CHECK: $ebx = MOV32rr $ebp
; CHECK: $ebx = ADD32rr $ebx, $ebp, implicit-def $eflags
; CHECK: $ebx = LEA32r killed $ebp, 1, $ebp, 0, $noreg
; CHECK: RETQ $ebx
$ebx = LEA32r killed $ebp, 1, $ebp, 0, $noreg
RETQ $ebx

View File

@ -873,7 +873,6 @@ body: |
; CHECK: liveins: $rax, $rbp, $rbx
; CHECK: $rbx = MOV64rr $rbp
; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags
; CHECK: $rbx = LEA64r killed $rbp, 1, $rbp, 0, $noreg
; CHECK: RETQ $ebx
$rbx = LEA64r killed $rbp, 1, $rbp, 0, $noreg
RETQ $ebx