[llvm] [RFC] Memory Model Relaxation Annotations (PR #78569)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 23:14:51 PDT 2024


================
@@ -793,13 +794,19 @@ Instruction *llvm::propagateMetadata(Instruction *Inst, ArrayRef<Value *> VL) {
   for (auto Kind : {LLVMContext::MD_tbaa, LLVMContext::MD_alias_scope,
                     LLVMContext::MD_noalias, LLVMContext::MD_fpmath,
                     LLVMContext::MD_nontemporal, LLVMContext::MD_invariant_load,
-                    LLVMContext::MD_access_group}) {
+                    LLVMContext::MD_access_group, LLVMContext::MD_mmra}) {
     MDNode *MD = I0->getMetadata(Kind);
-
     for (int J = 1, E = VL.size(); MD && J != E; ++J) {
       const Instruction *IJ = cast<Instruction>(VL[J]);
       MDNode *IMD = IJ->getMetadata(Kind);
+
       switch (Kind) {
+      case LLVMContext::MD_mmra: {
+        auto Tags = MMRAMetadata(dyn_cast_or_null<MDTuple>(MD));
----------------
Pierre-vh wrote:

> I get the impression that the MMRAMetadata helper class can be moved to the cpp file if all exposes APIs use only MDNode.

No, it's the API used by emitters to create MMRAs (e.g. Clang) and by consumers to parse it (e.g. SIMemoryLegalizer)

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


More information about the llvm-commits mailing list