[PATCH] D63401: SROA: Allow touching addrspacecast with volatile

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 30 11:21:09 PDT 2022


nlopes added a comment.

In D63401#3894996 <https://reviews.llvm.org/D63401#3894996>, @arsenm wrote:

> In D63401#3894885 <https://reviews.llvm.org/D63401#3894885>, @nlopes wrote:
>
>> It seems this patch contradicts the proposed LangRef patch. The LangRef patch says that you can't assume that a volatile operation yields the same result in different spaces.
>> And I think that's a fair condition. Otherwise we need to document that constraint for hardware vendors and change LangRef. Pick one of the patches basically :)
>
> This isn't contradictory. This is leaving the address space untouched, and doing the other simplifications SROA does (like replace byte arrays with int). A non-volatile access in this case would have been rewritten to point to the original alloca address space

Ah, my bad, I misread the summary.
The patch keeps the AS of the original instructions.

So the concept looks correct to me. But I don't know enough of the SROA's code to know if all transformations that are done are ok.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63401/new/

https://reviews.llvm.org/D63401



More information about the llvm-commits mailing list