[PATCH] [x86] add a reassociation optimization to increase ILP via the MachineCombiner pass

Sanjay Patel spatel at rotateright.com
Tue Jun 9 14:31:18 PDT 2015


Patch updated based on Gerolf's feedback:

1. Renamed patterns to be slightly more meaningful
2. Split functions that got much too big
3. Replace lengthy and repetitive 'switch' with selectable array for operand indexes

Also, while stepping through in the debugger, I discovered that my attempted recycling of a virtual register was causing the critical path calculation to be wrong, so I changed that to use a new VR (see comment in the code).

Finally, I added a comment regarding the machine combiner's internal logic: it replaces instructions even if there is no outright win in critical path or resources (just a tie). I'm not sure if that should be changed in a separate patch, but I think it would make it easier to generalize this reassociation pattern further while limiting the compile time hit. Ie, we don't need to have a sequence of 3 identical ops for this reassociation optimization, just 2.


http://reviews.llvm.org/D10321

Files:
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrInfo.h
  lib/Target/X86/X86TargetMachine.cpp
  test/CodeGen/X86/fp-fast.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10321.27400.patch
Type: text/x-patch
Size: 14466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/7f242916/attachment.bin>


More information about the llvm-commits mailing list