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

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 05:09:34 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));
----------------
ssahasra wrote:

Can this be combined into a single static function that takes to MDNode arguments and returns a new MDNode? I get the impression that the MMRAMetadata helper class can be moved to the cpp file if all exposes APIs use only MDNode.

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


More information about the llvm-commits mailing list