[Mlir-commits] [flang] [mlir] [mlir][acc][flang] Add genCast API to PointerLikeType (PR #192720)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Apr 17 12:27:22 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 -- flang/include/flang/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.h flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp mlir/test/lib/Dialect/OpenACC/TestPointerLikeTypeInterface.cpp mlir/unittests/Dialect/OpenACC/OpenACCTypeInterfacesTest.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/flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp b/flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp
index ba72e4643..9a8e7e47e 100644
--- a/flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp
+++ b/flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp
@@ -1604,9 +1604,11 @@ template bool OpenACCPointerLikeModel<fir::LLVMPointerType>::genStore(
     mlir::TypedValue<mlir::acc::PointerLikeType> destPtr) const;
 
 template <typename Ty>
-mlir::Value OpenACCPointerLikeModel<Ty>::genCast(
-    mlir::Type pointer, mlir::OpBuilder &builder, mlir::Location loc,
-    mlir::Value value, mlir::Type resultType) const {
+mlir::Value OpenACCPointerLikeModel<Ty>::genCast(mlir::Type pointer,
+                                                 mlir::OpBuilder &builder,
+                                                 mlir::Location loc,
+                                                 mlir::Value value,
+                                                 mlir::Type resultType) const {
   (void)pointer;
   if (value.getType() == resultType)
     return value;
diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index 6f49a6616..c54a77b69 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -327,8 +327,8 @@ struct LLVMPointerPointerLikeModel
     if (dstPtrTy) {
       Value intVal = value;
       if (isa<IndexType>(value.getType()))
-        intVal = arith::IndexCastUIOp::create(builder, loc, builder.getI64Type(),
-                                              value);
+        intVal = arith::IndexCastUIOp::create(builder, loc,
+                                              builder.getI64Type(), value);
       if (isa<IntegerType>(intVal.getType()))
         return LLVM::IntToPtrOp::create(builder, loc, resultType, intVal);
     }
diff --git a/mlir/unittests/Dialect/OpenACC/OpenACCTypeInterfacesTest.cpp b/mlir/unittests/Dialect/OpenACC/OpenACCTypeInterfacesTest.cpp
index 521a2f3f2..0d5419203 100644
--- a/mlir/unittests/Dialect/OpenACC/OpenACCTypeInterfacesTest.cpp
+++ b/mlir/unittests/Dialect/OpenACC/OpenACCTypeInterfacesTest.cpp
@@ -56,9 +56,9 @@ protected:
       IntegerType::attachInterface<TestReducibleIntegerModel>(*ctx);
     });
     context.appendDialectRegistry(registry);
-    context.loadDialect<acc::OpenACCDialect, arith::ArithDialect,
-                        memref::MemRefDialect, func::FuncDialect,
-                        LLVMDialect>();
+    context
+        .loadDialect<acc::OpenACCDialect, arith::ArithDialect,
+                     memref::MemRefDialect, func::FuncDialect, LLVMDialect>();
   }
 
   MLIRContext context;

``````````

</details>


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


More information about the Mlir-commits mailing list