[Bug tree-optimization/104408] SLP discovery fails due to -Ofast rewriting

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 7 08:55:55 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104408

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |53947
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
match.pd just does canonicalization here.  SLP discovery could handle this
in the existing swap operands or reassoc support but I guess the desire here
is to pull out a Complex SLP pattern.

So what should really be done in the end is get rid of the restriction during
SLP build that a node has to be from a single interleaving chain.  We can
handle {d[i].i, c[i].r} as permute of {d[i].r, d[i].i} and {c[i].r, c[i].i}
during discovery.  Of course doing that interferes with the swap-operands
logic which when successful will produce a more optimal initial SLP graph
but that relies on the recursive SLP discovery to first fail.

Forming an optimal SLP graph is likely NP complete so we have to employ
heuristics to some extent.

So - no perfect idea yet how to reliably match a Complex pattern here but
trying to attack this from the match.pd side sounds wrong.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations


More information about the Gcc-bugs mailing list