[Mlir-commits] [mlir] [mlir][acc] Add loop tiling utilities for OpenACC (PR #171490)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Dec 9 11:00:29 PST 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 h,cpp -- mlir/include/mlir/Dialect/OpenACC/OpenACCUtilsTiling.h mlir/lib/Dialect/OpenACC/Utils/OpenACCUtilsTiling.cpp mlir/unittests/Dialect/OpenACC/OpenACCUtilsTilingTest.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/unittests/Dialect/OpenACC/OpenACCUtilsTilingTest.cpp b/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTilingTest.cpp
index 287af9faf..07f2ca67d 100644
--- a/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTilingTest.cpp
+++ b/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTilingTest.cpp
@@ -58,9 +58,8 @@ protected:
// Helper to collect all nested acc.loop ops in order
SmallVector<acc::LoopOp> collectNestedLoops(acc::LoopOp loop) {
SmallVector<acc::LoopOp> loops;
- loop.getBody().walk([&](acc::LoopOp nestedLoop) {
- loops.push_back(nestedLoop);
- });
+ loop.getBody().walk(
+ [&](acc::LoopOp nestedLoop) { loops.push_back(nestedLoop); });
return loops;
}
@@ -109,7 +108,8 @@ TEST_F(OpenACCUtilsTilingTest, tileACCLoopsSingleLoop) {
SmallVector<acc::LoopOp> loopsToTile = {loopOp};
SmallVector<Value> tileSizes = {tileSize};
- acc::LoopOp tiledLoop = tileACCLoops(loopsToTile, tileSizes, /*defaultTileSize=*/128, rewriter);
+ acc::LoopOp tiledLoop =
+ tileACCLoops(loopsToTile, tileSizes, /*defaultTileSize=*/128, rewriter);
// Verify the tiled loop was created
EXPECT_TRUE(tiledLoop != nullptr);
@@ -185,7 +185,8 @@ TEST_F(OpenACCUtilsTilingTest, tileACCLoopsNestedLoops) {
SmallVector<acc::LoopOp> loopsToTile = {outerLoop, innerLoop};
SmallVector<Value> tileSizes = {tileSize1, tileSize2};
- acc::LoopOp tiledLoop = tileACCLoops(loopsToTile, tileSizes, /*defaultTileSize=*/128, rewriter);
+ acc::LoopOp tiledLoop =
+ tileACCLoops(loopsToTile, tileSizes, /*defaultTileSize=*/128, rewriter);
// Verify the tiled loop nest was created
EXPECT_TRUE(tiledLoop != nullptr);
@@ -317,8 +318,8 @@ TEST_F(OpenACCUtilsTilingTest, uncollapseLoopsThreeLevels) {
arith::ConstantOp::create(b, loc, b.getIndexType(), b.getIndexAttr(1));
// Create a collapsed loop with 3 IVs
- acc::LoopOp collapsedLoop = createLoopOp(b, {lb1, lb2, lb3}, {ub1, ub2, ub3},
- {step1, step2, step3});
+ acc::LoopOp collapsedLoop =
+ createLoopOp(b, {lb1, lb2, lb3}, {ub1, ub2, ub3}, {step1, step2, step3});
// Set collapse(2)
collapsedLoop.setCollapseForDeviceTypes(&context, {acc::DeviceType::None},
``````````
</details>
https://github.com/llvm/llvm-project/pull/171490
More information about the Mlir-commits
mailing list