[llvm] Add AMDGPU metadata to copyMetadataForLoad() (PR #110720)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 23 08:15:19 PDT 2024


================
@@ -3488,6 +3490,14 @@ void llvm::copyMetadataForLoad(LoadInst &Dest, const LoadInst &Source) {
       copyRangeMetadata(DL, Source, N, Dest);
       break;
     }
+    // Extended last-use / nontemporal hint on AMD GPUs
+    if (ID == Ctx.getMDKindID("amdpu.last.use"))
+      Dest.setMetadata(ID, N);
+    // Currently only relevant to atomics
+    else if (ID == Ctx.getMDKindID("amdgpu.no.remote.memory"))
+      Dest.setMetadata(ID, N);
+    else if (ID == Ctx.getMDKindID("amdgpu.no.fine.grained.memory"))
+      Dest.setMetadata(ID, N);
----------------
krzysz00 wrote:

I think I see your point re the atomic hints, but the `!amdgpu.last.use` would want to be an expanded `nontemporal`

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


More information about the llvm-commits mailing list