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 > operands. > > 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. Richard. > 2013-04-10 Richard Biener <rguent...@suse.de> > > * 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.