Replace a LEA instruction of the form 'lea (%esp), %ebx' --> 'mov %esp, %ebx'
MOV is preferable over LEA because usually there are more issue-slots available to execute MOVs than LEAs. Latest processors also support zero-latency MOVs.
Fixes pr29022.
Paths
| Differential D24705
[X86] Optimization for replacing LEA with MOV at frame index elimination time ClosedPublic Authored by zvi on Sep 18 2016, 1:26 AM.
Details Summary Replace a LEA instruction of the form 'lea (%esp), %ebx' --> 'mov %esp, %ebx' MOV is preferable over LEA because usually there are more issue-slots available to execute MOVs than LEAs. Latest processors also support zero-latency MOVs. Fixes pr29022.
Diff Detail
Event TimelineComment Actions Thanks, Zvi!
Comment Actions Thanks for the thorough review, Michael. I Will upload a revised patch,
zvi updated this object. zvi edited edge metadata. Comment ActionsNew revision addresses all Michael's comments except for the question whether erasing an instruction will invalidate an iterator - i am still looking into this. This revision is now accepted and ready to land.Sep 25 2016, 4:29 AM Closed by commit rL282385: [X86] Optimization for replacing LEA with MOV at frame index elimination time (authored by zvi). · Explain WhySep 25 2016, 11:51 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 72440 llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
llvm/trunk/test/CodeGen/X86/avx-intel-ocl.ll
llvm/trunk/test/CodeGen/X86/avx512-intel-ocl.ll
llvm/trunk/test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll
llvm/trunk/test/CodeGen/X86/dynamic-allocas-VLAs.ll
llvm/trunk/test/CodeGen/X86/extractelement-index.ll
llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll
llvm/trunk/test/CodeGen/X86/fast-isel-x86.ll
llvm/trunk/test/CodeGen/X86/frameaddr.ll
llvm/trunk/test/CodeGen/X86/lea-opt-memop-check-1.ll
llvm/trunk/test/CodeGen/X86/local_stack_symbol_ordering.ll
llvm/trunk/test/CodeGen/X86/pr29022.ll
llvm/trunk/test/CodeGen/X86/sse-intel-ocl.ll
llvm/trunk/test/CodeGen/X86/sse-intrinsics-fast-isel.ll
llvm/trunk/test/CodeGen/X86/swift-return.ll
llvm/trunk/test/CodeGen/X86/win32_sret.ll
llvm/trunk/test/CodeGen/X86/win64_frame.ll
llvm/trunk/test/DebugInfo/COFF/inlining.ll
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||