[X86] Replace slow LEA instructions in X86
authorLama Saba <lama.saba@intel.com>
Thu, 18 May 2017 08:11:50 +0000 (08:11 +0000)
committerLama Saba <lama.saba@intel.com>
Thu, 18 May 2017 08:11:50 +0000 (08:11 +0000)
commit2ea271b54a702adcb014eb9d072faa04d74c9a1b
treeb4a2d8d466d08b0c6dfedfea042f87d4bb80cf4c
parent994b6c9b8e7d0d22032aa66edd09701e8df1dfd1
[X86] Replace slow LEA instructions in X86

  According to Intel's Optimization Reference Manual for SNB+:
  " For LEA instructions with three source operands and some specific situations, instruction latency has increased to 3 cycles, and must
    dispatch via port 1:
  - LEA that has all three source operands: base, index, and offset
  - LEA that uses base and index registers where the base is EBP, RBP,or R13
  - LEA that uses RIP relative addressing mode
  - LEA that uses 16-bit addressing mode "
  This patch currently handles the first 2 cases only.

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

llvm-svn: 303333
llvm/lib/Target/X86/X86.td
llvm/lib/Target/X86/X86FixupLEAs.cpp
llvm/lib/Target/X86/X86Subtarget.cpp
llvm/lib/Target/X86/X86Subtarget.h
llvm/lib/Target/X86/X86TargetMachine.cpp
llvm/test/CodeGen/X86/leaFixup32.mir [new file with mode: 0644]
llvm/test/CodeGen/X86/leaFixup64.mir [new file with mode: 0644]