[Mlir-commits] [mlir] [mlir][LLVMIR] Support memory model relaxation annotations (MMRA) (PR #157770)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Sep 10 09:09:33 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
index 736b1fe5b..2009c0d5c 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
@@ -221,9 +221,9 @@ static LogicalResult setDereferenceableAttr(const llvm::MDNode *node,
 static LogicalResult setMmraAttr(llvm::MDNode *node, Operation *op,
                                  LLVM::ModuleImport &moduleImport) {
   llvm::MMRAMetadata wrapper(node);
-  if (wrapper.empty()) 
+  if (wrapper.empty())
     return success();
- 
+
   MLIRContext *ctx = op->getContext();
   Attribute mlirMmra;
   if (wrapper.size() == 1) {
@@ -231,7 +231,7 @@ static LogicalResult setMmraAttr(llvm::MDNode *node, Operation *op,
     mlirMmra = LLVM::MMRATagAttr::get(ctx, prefix, suffix);
   } else {
     SmallVector<Attribute> tags;
-    for (auto [prefix, suffix] : wrapper) 
+    for (auto [prefix, suffix] : wrapper)
       tags.push_back(LLVM::MMRATagAttr::get(ctx, prefix, suffix));
     mlirMmra = ArrayAttr::get(ctx, tags);
   }
diff --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
index 5093b2a47..7ec416406 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
@@ -754,7 +754,7 @@ amendOperationImpl(Operation &op, ArrayRef<llvm::Instruction *> instructions,
       // Empty list, canonicalizes to nothing
       return success();
     }
-    for (llvm::Instruction *inst : instructions) 
+    for (llvm::Instruction *inst : instructions)
       inst->setMetadata(llvm::LLVMContext::MD_mmra, mmraMd);
     return success();
   }

``````````

</details>


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


More information about the Mlir-commits mailing list