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

Gerolf Hoflehner ghoflehner at apple.com
Tue Jun 9 15:41:33 PDT 2015


Please see below.
> On Jun 9, 2015, at 2:31 PM, Sanjay Patel <spatel at rotateright.com> wrote:
> 
> 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).
Good observation. It sounds like we should use a pattern to parameterize the cost function in the combiner.
> 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/
> <D10321.27400.patch>





More information about the llvm-commits mailing list