[Mlir-commits] [mlir] [MLIR][NFC] Stop depending on func.func in affine LoopUtils via &Region (PR #83325)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Feb 28 12:10:16 PST 2024


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 24f025175d8adc5cafa277777c2361b55610eab3 25ca48c92799cfe59612ece465fd79a7b22e16e2 -- mlir/include/mlir/Dialect/Affine/LoopUtils.h mlir/include/mlir/Dialect/Affine/Utils.h mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp mlir/lib/Dialect/Affine/Transforms/AffineLoopNormalize.cpp mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp mlir/lib/Dialect/Affine/Utils/LoopFusionUtils.cpp mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp mlir/lib/Dialect/Affine/Utils/Utils.cpp mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp mlir/test/lib/Dialect/Affine/TestAffineLoopParametricTiling.cpp mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
index 7908d2f63e..85ced4d6a3 100644
--- a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
+++ b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
@@ -310,8 +310,7 @@ transform::LoopUnrollOp::applyToOne(transform::TransformRewriter &rewriter,
   LogicalResult result(failure());
   if (scf::ForOp scfFor = dyn_cast<scf::ForOp>(op)) {
     result = loopUnrollByFactor(scfFor, getFactor());
-  }
-  else if (AffineForOp affineFor = dyn_cast<AffineForOp>(op)) {
+  } else if (AffineForOp affineFor = dyn_cast<AffineForOp>(op)) {
     auto &topRegion = affineFor->getParentOfType<func::FuncOp>().getBody();
     result = loopUnrollByFactor(topRegion, affineFor, getFactor());
   }
diff --git a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp
index 8fd6d5f7c9..b5dcd13ece 100644
--- a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp
+++ b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp
@@ -119,8 +119,7 @@ void TestAffineDataCopy::runOnOperation() {
         (void)promoteIfSingleIteration(topRegion, forOp);
       } else if (auto loadOp = dyn_cast<AffineLoadOp>(op)) {
         copyOps.push_back(loadOp);
-      }
-      else if (auto storeOp = dyn_cast<AffineStoreOp>(op)) {
+      } else if (auto storeOp = dyn_cast<AffineStoreOp>(op)) {
         copyOps.push_back(storeOp);
       }
     });

``````````

</details>


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


More information about the Mlir-commits mailing list