Map IntrHasSideEffects to a read+write of inaccessible memory, which is the usual way to represent a side effect that cannot be modelled more precisely.
This means that IntrNoMem + IntrHasSideEffects is reduced from reading and writing all memory to only accessing inaccessible memory, while IntrReadMem + IntrHasSideEffects is now no longer readonly (which is clearly incorrect as it e.g. allows simply removing the side effect).
The fact that IntrNoMem + IntrHasSideEffects is no longer an arbitrary read and write may cause issues for existing intrinsics marked as such. In particular, I think the llvm.amdgcn.s.barrier test changes here look incorrect -- if I understand the semantics of that intrinsic correctly, then moving loads/stores across the intrinsic is not legal, and the current IntrNoMem marking is simply incorrect. Can somebody from the AMDGPU side please confirm what the intended semantics are?
As counter intuitive as it is, I think this is correct. Can you add a second copy of this test. that uses a fence to show it still isn't moved?