[X86] Optimization for replacing LEA with MOV at frame index elimination time
authorZvi Rackover <zvi.rackover@intel.com>
Mon, 26 Sep 2016 06:42:07 +0000 (06:42 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Mon, 26 Sep 2016 06:42:07 +0000 (06:42 +0000)
commit839d15a194a658dfe407e1681514231455138360
tree554c7066bdf9216a5962edd93e21927bf4d9705c
parent9d68b64c00e43a5b5430c5cdbd78f4ae85aab0b4
[X86] Optimization for replacing LEA with MOV at frame index elimination time

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.

Reviewers: hfinkel, delena, igorb, myatsina, mkuper

Differential Revision: https://reviews.llvm.org/D24705

llvm-svn: 282385
18 files changed:
llvm/lib/Target/X86/X86RegisterInfo.cpp
llvm/test/CodeGen/X86/avx-intel-ocl.ll
llvm/test/CodeGen/X86/avx512-intel-ocl.ll
llvm/test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll
llvm/test/CodeGen/X86/dynamic-allocas-VLAs.ll
llvm/test/CodeGen/X86/extractelement-index.ll
llvm/test/CodeGen/X86/fast-isel-x86-64.ll
llvm/test/CodeGen/X86/fast-isel-x86.ll
llvm/test/CodeGen/X86/frameaddr.ll
llvm/test/CodeGen/X86/lea-opt-memop-check-1.ll
llvm/test/CodeGen/X86/local_stack_symbol_ordering.ll
llvm/test/CodeGen/X86/pr29022.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/sse-intel-ocl.ll
llvm/test/CodeGen/X86/sse-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/swift-return.ll
llvm/test/CodeGen/X86/win32_sret.ll
llvm/test/CodeGen/X86/win64_frame.ll
llvm/test/DebugInfo/COFF/inlining.ll