[llvm] 3adc819 - [X86] Erase dead LEA instruction after converting it to MOV in FixupLEAPass::processInstrForSlow3OpLEA.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 11 07:52:09 PST 2019
Author: Craig Topper
Date: 2019-12-11T07:51:23-08:00
New Revision: 3adc819b7a074f101924e12a08d0aaeb8b16b9a1
URL: https://github.com/llvm/llvm-project/commit/3adc819b7a074f101924e12a08d0aaeb8b16b9a1
DIFF: https://github.com/llvm/llvm-project/commit/3adc819b7a074f101924e12a08d0aaeb8b16b9a1.diff
LOG: [X86] Erase dead LEA instruction after converting it to MOV in FixupLEAPass::processInstrForSlow3OpLEA.
Added:
Modified:
llvm/lib/Target/X86/X86FixupLEAs.cpp
llvm/test/CodeGen/X86/leaFixup32.mir
llvm/test/CodeGen/X86/leaFixup64.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86FixupLEAs.cpp b/llvm/lib/Target/X86/X86FixupLEAs.cpp
index 46cb467485c4..9ac401bb0253 100644
--- a/llvm/lib/Target/X86/X86FixupLEAs.cpp
+++ b/llvm/lib/Target/X86/X86FixupLEAs.cpp
@@ -650,6 +650,9 @@ void FixupLEAPass::processInstrForSlow3OpLEA(MachineBasicBlock::iterator &I,
.addReg(DestReg)
.add(Index);
LLVM_DEBUG(NewMI->dump(););
+
+ MBB.erase(I);
+ I = NewMI;
return;
}
diff --git a/llvm/test/CodeGen/X86/leaFixup32.mir b/llvm/test/CodeGen/X86/leaFixup32.mir
index 23f3d7616966..9fe5b190c154 100644
--- a/llvm/test/CodeGen/X86/leaFixup32.mir
+++ b/llvm/test/CodeGen/X86/leaFixup32.mir
@@ -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
diff --git a/llvm/test/CodeGen/X86/leaFixup64.mir b/llvm/test/CodeGen/X86/leaFixup64.mir
index 673d43ea71a1..7fdf582055c2 100644
--- a/llvm/test/CodeGen/X86/leaFixup64.mir
+++ b/llvm/test/CodeGen/X86/leaFixup64.mir
@@ -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
More information about the llvm-commits
mailing list