[llvm] [llvm][opt][Transforms] Preserve AMDGPU atomic metadata (PR #140314)
Alex Voicu via llvm-commits
llvm-commits at lists.llvm.org
Mon May 19 16:25:28 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")};
----------------
AlexVlx wrote:
Possibly, but there's no other example of target specific MD in the fixed enum. It's also not quite clear where else we could handle these (if you have something in mind, please share). I will re-factor this a bit anyway because it's incomplete (we're missing cases where the replaces Instr carries the MD).
https://github.com/llvm/llvm-project/pull/140314
More information about the llvm-commits
mailing list