Please review: Optimize vector multiply on X86

Benjamin Kramer benny.kra at gmail.com
Sun Jun 16 06:31:47 PDT 2013


On 16.06.2013, at 14:22, "Demikhovsky, Elena" <elena.demikhovsky at intel.com> wrote:

> I added an optimization that converts vector operation multiply by const to SHIFT.
> I did this optimization for X86 only.
> I’m wondering why it was not implemented for all targets.  I saw a proposal sent by Andrea about month ago, but it is, probably, was rejected.

Andrea's patch went into trunk as r183005. It's a mid-level optimization though (in instcombine) so you'll see the effect with opt but not with llc.

I think shl is the canonical version of a mul and I don't see why adding this as an x86-specific optimization provides any additional value. If these occur in places where instcombine can't catch them it may make sense to do it in the target-independent part of DAGCombiner.

- Ben



More information about the llvm-commits mailing list