[Mlir-commits] [mlir] [mlir][emitc] Add a structured for operation (PR #68206)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 4 04:09:07 PDT 2023


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 9f406e450b6dfebe41be54cc7a7a6861b8eaf618 b5c03d16ae6c3176bcaf34a0d2e091c41c3d3ff3 -- mlir/include/mlir/Dialect/EmitC/IR/EmitC.h mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp mlir/lib/Dialect/EmitC/IR/EmitC.cpp mlir/lib/Target/Cpp/TranslateToCpp.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp b/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
index 22041344b..3d145e307 100644
--- a/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
+++ b/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
@@ -157,17 +157,17 @@ LogicalResult IfLowering::matchAndRewrite(IfOp ifOp,
   SmallVector<Value> resultVariables =
       createVariablesForResults(ifOp, rewriter);
 
-   // Utility function to lower the contents of an scf::if region to an emitc::if
-   // region. The contents of the scf::if regions is moved into the respective
-   // emitc::if regions, but the scf::yield is replaced not only with an
-   // emitc::yield, but also with a sequence of emitc::assign ops that set the
-   // yielded values into the result variables.
-   auto lowerRegion = [&resultVariables, &rewriter](Region &region,
-                                                    Region &loweredRegion) {
-     rewriter.inlineRegionBefore(region, loweredRegion, loweredRegion.end());
-     Operation *terminator = loweredRegion.back().getTerminator();
-     lowerYield(resultVariables, rewriter, cast<scf::YieldOp>(terminator));
-   };
+  // Utility function to lower the contents of an scf::if region to an emitc::if
+  // region. The contents of the scf::if regions is moved into the respective
+  // emitc::if regions, but the scf::yield is replaced not only with an
+  // emitc::yield, but also with a sequence of emitc::assign ops that set the
+  // yielded values into the result variables.
+  auto lowerRegion = [&resultVariables, &rewriter](Region &region,
+                                                   Region &loweredRegion) {
+    rewriter.inlineRegionBefore(region, loweredRegion, loweredRegion.end());
+    Operation *terminator = loweredRegion.back().getTerminator();
+    lowerYield(resultVariables, rewriter, cast<scf::YieldOp>(terminator));
+  };
 
   Region &thenRegion = ifOp.getThenRegion();
   Region &elseRegion = ifOp.getElseRegion();

``````````

</details>


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


More information about the Mlir-commits mailing list