This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC] Handle commutative operations in SLP tree build
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 Apr 2013 14:14:58 +0200 (CEST)
- Subject: Re: [PATCH][RFC] Handle commutative operations in SLP tree build
- References: <alpine dot LNX dot 2 dot 00 dot 1304101551370 dot 21094 at zhemvz dot fhfr dot qr>
On Wed, 10 Apr 2013, Richard Biener wrote:
> This handles commutative operations during SLP tree build in the
> way that if one configuration does not match, the build will
> try again with commutated operands for. This allows to remove
> the special-casing of commutated loads in a complex addition
> that was in the end handled as "permutation". It of course
> also applies more generally. Permutation is currently limited
> to 3 unsuccessful permutes to avoid running into the inherently
> exponential complexity of tree matching.
> The gcc.dg/vect/vect-complex-?.c testcases provide some testing
> coverage (previously handled by the special-casing). I have
> seen failed SLP in the wild previously but it's usually on
> larger testcases and dependent on operand order of commutative
> I've discussed ideas to restrict the cases where we try a permutation
> with Matz, but I'll rather defer that to an eventual followup.
> (compute per SSA name a value dependent on the shape of its
> use-def tree and use that as a quick check whether sub-trees
> can possibly match)
> Bootstrap and regtest running on x86_64-unknown-linux-gnu.
> Any comments?
Committed to trunk.
> 2013-04-10 Richard Biener <email@example.com>
> * tree-vect-slp.c (vect_build_slp_tree_1): Split out from ...
> (vect_build_slp_tree): ... here.
> (vect_build_slp_tree_1): Compute which stmts of the SLP group
> match. Remove special-casing of mismatched complex loads.
> (vect_build_slp_tree): Based on the result from vect_build_slp_tree_1
> re-try the match with swapped commutative operands.
> (vect_supported_load_permutation_p): Remove special-casing of
> mismatched complex loads.
> (vect_analyze_slp_instance): Adjust.