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

Sanjay Patel spatel at rotateright.com
Mon Jun 8 14:49:26 PDT 2015


Hi Gerolf, joker.eph, resistor, escha, qcolombet, jmolloy,

This is a reimplementation of D9780 at the machine instruction level rather than the DAG.

I'm using the MachineCombiner pass to reassociate scalar single-precision AVX additions (just a starting point; see the TODO comment) to increase ILP when it's safe to do so. 

The code is closely based on the existing MachineCombiner optimization that is implemented for AArch64.

I tried the test cases that Mehdi provided in the follow-up thread for r236031, and I don't see any instruction count increase. In the massive test case (~8000 machine instructions) that blew up previously, this optimization will fire ~2000 times. This causes a horrible compile-time increase: 
  $ time llc -enable-unsafe-fp-math -x86-machine-combiner=0 -mattr=avx spill.ll
  1.8 sec
  $ time llc -enable-unsafe-fp-math -x86-machine-combiner=1 -mattr=avx spill.ll
  35.8 sec

For now, I'm assuming that this is a degenerate test case (for x86 at least) that we don't need to artificially limit, but we could also clip the optimization to only fire N times.

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.27331.patch
Type: text/x-patch
Size: 15024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150608/2b5d7c71/attachment.bin>


More information about the llvm-commits mailing list