[Mlir-commits] [mlir] [MLIR] Improve KernelOutlining to avoid introducing an extra block (PR #90359)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Apr 28 06:19:28 PDT 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 de375fbc713b7c5cd0e3377a49f0773300203b63 b59a889d1c34817317dff90814f29a5a13fd7a68 -- mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
index ea7cd3f943..f5e80553ae 100644
--- a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
@@ -247,13 +247,13 @@ static gpu::GPUFuncOp outlineKernelFuncImpl(gpu::LaunchOp launchOp,
   for (Block &block : launchOpBody) {
     Block *clonedBlock = map.lookup(&block);
     auto terminator = dyn_cast<gpu::TerminatorOp>(clonedBlock->getTerminator());
-    if (!terminator) continue;
+    if (!terminator)
+      continue;
     OpBuilder replacer(terminator);
     replacer.create<gpu::ReturnOp>(terminator->getLoc());
     terminator->erase();
   }
 
-
   // Splice now the entry block of the gpu.launch operation at the end of the
   // gpu.func entry block and erase the redundant block.
   Block *clonedLaunchOpEntry = map.lookup(&launchOpBody.front());

``````````

</details>


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


More information about the Mlir-commits mailing list