[llvm] [llvm][opt][Transforms] Preserve AMDGPU atomic metadata (PR #140314)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 23:24:30 PDT 2025


================
@@ -3303,6 +3303,12 @@ static void combineMetadata(Instruction *K, const Instruction *J,
                             bool DoesKMove, bool AAOnly = false) {
   SmallVector<std::pair<unsigned, MDNode *>, 4> Metadata;
   K->getAllMetadataOtherThanDebugLoc(Metadata);
+
+  const unsigned AMDGPUMD[] = {
+      K->getContext().getMDKindID("amdgpu.no.fine.grained.memory"),
+      K->getContext().getMDKindID("amdgpu.no.remote.memory"),
+      K->getContext().getMDKindID("amdgpu.ignore.denormal.mode")};
----------------
arsenm wrote:

Should avoid looking up these IDs until they are finally needed below.

If we're going to handle these here, we probably ought to promote these to recognized enum metadata 

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


More information about the llvm-commits mailing list