DSE and maskstore trouble
Andrew Stubbs
andrew_stubbs@mentor.com
Tue Jul 3 10:57:00 GMT 2018
On 03/07/18 11:33, Andrew Stubbs wrote:
> On 03/07/18 11:15, Richard Biener wrote:
>> AVX ones are all UNSPECs I believe - how do your patterns look like?
>
> AVX has both unspec and vec_merge variants (at least for define_expand,
> in GCC8), but in any case, AFAICT dse.c only cares about the destination
> MEM, and all the AVX and SVE patterns appear to use nothing special there.
Sorry, my patterns look something like this:
(set (mem:V64DI (reg:DI)
(vec_merge:V64DI (reg:V64DI) (unspec ...) (reg:DI)))
Where the unspec just means that the destination remains unchanged. We
could also use (match_dup 0) there, but we don't, so probably there was
an issue with that at some point.
>>> I was thinking of solving the problem by adding a target hook to query
>>> the true length of vector types. Any thoughts on that?
>>
>> It isn't about the length but about the mask because there can be mask
>> values that do not affect the length?
>
> The problem I have right now is that the vector write conflicts with
> writes to distinct variables, in which case the vector length is what's
> important, and it's probably(?) safe to assume that if the vector mask
> is not constant then space for the whole vector has been allocated on
> the stack.
>
> But yes, in general it's true that subsequent writes to the same vector
> could well write distinct elements, in which case the value of the mask
> is significant to DSE analysis.
>
> Andrew
More information about the Gcc
mailing list