[PATCH] D141980: [X86] Transform slow LEA_B_I_D/LEA_SLOWBASE_I -> LEA_IS_D/LEA_IS iff base == index

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 17:05:09 PST 2023


goldstein.w.n created this revision.
Herald added subscribers: pengfei, arphaman, hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The two 3c LEA cases:

  lea D(base, index,1)      -> lea D(,index,2)
  lea D(r13/rbp, index)     -> lea D(,r13/rbp,2) // D maybe zero

Current take 2 instructions to transform. We can do a bit better by
using LEA w.o a base if base == index and scale == 1.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141980

Files:
  llvm/lib/Target/X86/X86FixupLEAs.cpp
  llvm/test/CodeGen/X86/leaFixup32.mir
  llvm/test/CodeGen/X86/leaFixup64.mir
  llvm/test/CodeGen/X86/select-1-or-neg1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141980.489990.patch
Type: text/x-patch
Size: 4965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230118/bc3ca874/attachment.bin>


More information about the llvm-commits mailing list