On July 3, 2018 5:19:24 PM GMT+02:00, Andrew Stubbs <andrew_stu...@mentor.com> 
wrote:
>On 03/07/18 14:52, Richard Biener wrote:
>> If you look at RTL dumps (with -fstrict-aliasing, thus -O2+) you
>should
>> see MEM_ALIAS_SETs differing for the earlier stores and the masked
>> store uses.
>> 
>> Now I'm of course assuming DSE is perfect, maybe it isn't ... ;)
>
>Ok, I see that the stores have MEMs with different alias sets, indeed.
>I 
>can't quite work out if that means it's safe, or unsafe? Do I still
>need 
>to zero the set?

I think you need to zero the set of the load in the masked store. The AVX 
patterns suffer from the same issue here. 
Of course I'm not sure if we can construct a miscompilation here but I wouldn't 
be surprised if we can. 

>For masked stores, clearly the current DSE implementation must be 
>sub-optimal because it ignores the mask. Writing it as a 
>load/modify/write means that stores are not erroneously removed, but 
>also means that redundant writes (to masked vector destinations) are 
>never removed. Anyway, at least I know how to make that part safe now.

Yeah. 

Richard. 
>
>Thanks
>
>Andrew

Reply via email to