[llvm] [AMDGPU] Set glc/slc on volatile/nontemporal SMEM loads (PR #77443)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 23:07:15 PST 2024


================
@@ -29,7 +29,6 @@ class SM_Pseudo <string opName, dag outs, dag ins, string asmOps, list<dag> patt
   let mayStore = 0;
   let mayLoad = 1;
   let hasSideEffects = 0;
-  let maybeAtomic = 0;
----------------
jayfoad wrote:

> How does removing this cause SIMemoryLegalizer to process scalar loads and stores?

Not setting `maybeAtomic = 0` on SMEM Pseudos means that they all inherit the default of `maybeAtomic = 1`. The main loop in `SIMemoryLegalizer::runOnMachineFunction` ignores anything that is not marked as `maybeAtomic`.

> Should the memory model in AMDGPUUsage be updated to include the scalar memory instructions?

Probably. Are you saying that should be a prerequisite for this patch?

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


More information about the llvm-commits mailing list