[llvm] [SystemZ] Don't lower float/double ATOMIC_[LOAD|STORE] to [LOAD|STORE] (PR #75879)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 16:40:21 PST 2023


JonPsson1 wrote:

I am not sure which I think would be best: it seems natural to simply have "LOAD" as it has the MMO with the atomic bits. On the other hand, it kind of feel safer to have the ATOMIC_LOAD opcode to keep it separate from all optimizations on LOADs, even though guarding that with a simple isAtomic() check might be simple enough.

I guess the next step might be to rework the SystemZ implementation with this patch and even after that the ATOMIC_LOAD could be eliminated at some future point if needed. 

Strictly speaking though, from a SystemZ backend perspective it would be simpler to just have the LOAD opcode as the same instruction is to be selected. Not sure how much work that would be, but we would have to be sure that the MMO is properly preserved everywhere, that optimizations are guarded with an isAtomic() check, and that backends like PowerPC selecting atomic loads with ATOMIC_LOAD learned how to do that by checking the MMO of a LOAD instead.




https://github.com/llvm/llvm-project/pull/75879


More information about the llvm-commits mailing list