[Mlir-commits] [mlir] [mlir][ABI] Add ABITypeMapper and ABIRewriteContext (PR #190661)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Apr 6 12:41:09 PDT 2026


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 h,cpp -- mlir/include/mlir/ABI/ABIRewriteContext.h mlir/include/mlir/ABI/ABITypeMapper.h mlir/lib/ABI/ABITypeMapper.cpp mlir/unittests/ABI/ABIRewriteContextTest.cpp mlir/unittests/ABI/ABITypeMapperTest.cpp --diff_from_common_commit
``````````

: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/include/mlir/ABI/ABIRewriteContext.h b/mlir/include/mlir/ABI/ABIRewriteContext.h
index ff589d0d0..71d5a56b5 100644
--- a/mlir/include/mlir/ABI/ABIRewriteContext.h
+++ b/mlir/include/mlir/ABI/ABIRewriteContext.h
@@ -87,8 +87,7 @@ struct ArgClassification {
     return c;
   }
 
-  static ArgClassification getIndirect(llvm::Align align,
-                                       bool byVal = true) {
+  static ArgClassification getIndirect(llvm::Align align, bool byVal = true) {
     ArgClassification c;
     c.Kind = ArgKind::Indirect;
     c.IndirectAlign = align;
diff --git a/mlir/lib/ABI/ABITypeMapper.cpp b/mlir/lib/ABI/ABITypeMapper.cpp
index cfffae7b7..c7a69780b 100644
--- a/mlir/lib/ABI/ABITypeMapper.cpp
+++ b/mlir/lib/ABI/ABITypeMapper.cpp
@@ -44,8 +44,7 @@ const llvm::abi::Type *ABITypeMapper::map(mlir::Type type) {
                                 /*Signed=*/false);
 }
 
-const llvm::abi::Type *
-ABITypeMapper::mapIntegerType(mlir::IntegerType type) {
+const llvm::abi::Type *ABITypeMapper::mapIntegerType(mlir::IntegerType type) {
   uint64_t width = type.getWidth();
   uint64_t abiAlign = DL.getTypeABIAlignment(type);
   // MLIR signless integers are treated as signed for ABI purposes.
diff --git a/mlir/unittests/ABI/ABIRewriteContextTest.cpp b/mlir/unittests/ABI/ABIRewriteContextTest.cpp
index 7c035036b..04c28991c 100644
--- a/mlir/unittests/ABI/ABIRewriteContextTest.cpp
+++ b/mlir/unittests/ABI/ABIRewriteContextTest.cpp
@@ -22,8 +22,7 @@ public:
     return success();
   }
 
-  LogicalResult rewriteCallSite(Operation *,
-                                const FunctionClassification &,
+  LogicalResult rewriteCallSite(Operation *, const FunctionClassification &,
                                 OpBuilder &) override {
     return success();
   }
@@ -87,8 +86,7 @@ TEST(ABIRewriteContextTest, FunctionClassificationHoldsReturnAndArgs) {
   FunctionClassification fc;
   fc.ReturnInfo = ArgClassification::getDirect();
   fc.ArgInfos.push_back(ArgClassification::getDirect());
-  fc.ArgInfos.push_back(
-      ArgClassification::getIndirect(llvm::Align(8), true));
+  fc.ArgInfos.push_back(ArgClassification::getIndirect(llvm::Align(8), true));
   fc.ArgInfos.push_back(ArgClassification::getIgnore());
 
   EXPECT_EQ(fc.ReturnInfo.Kind, ArgKind::Direct);

``````````

</details>


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


More information about the Mlir-commits mailing list