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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 10:10:41 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);
----------------
arsenm wrote:

This is too ugly to speculatively save here. If we want to move this, we should move them to be first class recognized enum metadata 

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


More information about the llvm-commits mailing list