[PATCH] fix useless unsharing of SLP tree

Richard Sandiford richard.sandiford@arm.com
Thu Sep 10 10:46:59 GMT 2020


Richard Biener <rguenther@suse.de> writes:
> On Thu, 10 Sep 2020, Richard Sandiford wrote:
>
>> Richard Biener <rguenther@suse.de> writes:
>> > This avoids unsharing the SLP tree when optimizing load permutations
>> > for reductions but there is no actual permute taking place.
>> >
>> > Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
>> >
>> > 2020-09-09  Richard Biener  <rguenther@suse.de>
>> >
>> > 	* tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Do
>> > 	nothing when the permutation doesn't permute.
>> 
>> Drive-by comment, sorry for not looking in more detail first, but:
>> is there a difference in semantics between an identity load_permutation
>> and a null load_permutation?  Seems like it would be good to have
>> a canonical form.
>
> Well, yes - an identity load_permutation will become non-identity
> if there's a GROUP_GAP and we end up with a VF > 1.  We're simply
> postponing figuring this out until we have VF fixed (and
> vect_attempt_slp_rearrange_stmts is quite legacy now and at an
> odd place - sth I hope to address).  So with GROUP_GAP == 1
> and an identity permute the permute should be NULL.
>
> I've run into this during development of other stuff but decided
> to push this fix since it might as well happen for the SLP
> reduction case.  It's probably a regression from when I pushed
> permute validity check to vectorizable_load.

Ah, OK, thanks.

Richard


More information about the Gcc-patches mailing list