[llvm] [RFC] Memory Model Relaxation Annotations (PR #78569)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 20:17:58 PDT 2024


ssahasra wrote:

> > ere is an opposite "safe by default" choice, which is to say that we will teach every conceivable transform to back off when MMRAs are present, and then re-enable each of them by teaching them how to deal with MMRAs. That sounds like overkill. The first choice is
> 
> Looking back, I also think that in some cases, dropping MMRAs may be acceptable if it means removing an entire branch/load/store/etc, so it was indeed premature of me to prevent things like CSE in the presence of MMRAs.

So far, I have only been thinking about merging MMRAs ... but choosing between two operations cannot be this straight-forward. Say there are two equivalent loads A and B, with different MMRAs. How can a transform know whether it is safe to drop one and reuse the other? What if A is a vulkan:private and B is a vulkan:nonprivate? Clearly, it's safer to drop A and reuse B in order to preserve happens-before.

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


More information about the llvm-commits mailing list