mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-19 11:41:53 +00:00
[X86] Fix killed flag handling in X86FixupLea pass
When pass creates a MOV instruction for lea (%base,%index,1), %dst => mov %base,%dst; add %index,%dst modification it should clean the killed flag for base if base is equal to index. Otherwise verifier complains about usage of killed register in add instruction. Reviewers: lsaba, zvi, zansari, aaboud Reviewed By: lsaba Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42522 llvm-svn: 323497
This commit is contained in:
parent
106aa3e46d
commit
7d96f22167
@ -548,7 +548,8 @@ FixupLEAPass::processInstrForSlow3OpLEA(MachineInstr &MI,
|
||||
|
||||
// lea (%base,%index,1), %dst => mov %base,%dst; add %index,%dst
|
||||
if (IsScale1 && !hasLEAOffset(Offset)) {
|
||||
TII->copyPhysReg(*MFI, MI, DL, DstR, BaseR, Base.isKill());
|
||||
bool BIK = Base.isKill() && BaseR != IndexR;
|
||||
TII->copyPhysReg(*MFI, MI, DL, DstR, BaseR, BIK);
|
||||
DEBUG(MI.getPrevNode()->dump(););
|
||||
|
||||
MachineInstr *NewMI =
|
||||
|
@ -354,7 +354,7 @@ body: |
|
||||
; CHECK: %ebx = MOV32rr %ebp
|
||||
; CHECK: %ebx = ADD32rr %ebx, %ebp
|
||||
|
||||
%ebx = LEA32r %ebp, 1, %ebp, 0, %noreg
|
||||
%ebx = LEA32r killed %ebp, 1, %ebp, 0, %noreg
|
||||
RETQ %ebx
|
||||
|
||||
...
|
||||
|
@ -810,7 +810,7 @@ body: |
|
||||
; CHECK: %rbx = MOV64rr %rbp
|
||||
; CHECK: %rbx = ADD64rr %rbx, %rbp
|
||||
|
||||
%rbx = LEA64r %rbp, 1, %rbp, 0, %noreg
|
||||
%rbx = LEA64r killed %rbp, 1, %rbp, 0, %noreg
|
||||
RETQ %ebx
|
||||
|
||||
...
|
||||
|
Loading…
x
Reference in New Issue
Block a user