[PATCH] D60993: [X86] Initial cleanups on the FixupLEAs pass. Separate Atom LEA creation from other LEA optimizations.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 22:53:24 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This removes some of the class variables. Merge basic block processing into
runOnMachineFunction to keep the flags local.

Pass MachineBasicBlock around instead of an iterator. We can get the iterator in
the few places that need it. Allows a range-based outer for loop.

Separate the Atom optimization from the rest of the optimizations. This allows
fixupIncDec to create INC/DEC and still allow Atom to turn it back into LEA
when profitable by its heuristics.

I'd like to improve fixupIncDec to turn LEAs into ADD any time the base or index
register is equal to the destination register. This is profitable regardless of
the various slow flags. But again we would want Atom to be able to undo that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60993

Files:
  llvm/lib/Target/X86/X86FixupLEAs.cpp
  llvm/test/CodeGen/X86/lsr-static-addr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60993.196183.patch
Type: text/x-patch
Size: 19019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190423/ec589ba3/attachment.bin>


More information about the llvm-commits mailing list