[Mlir-commits] [mlir] [mlir][vector] Refactor parts of `VectorToSCF.cpp` (NFC) (PR #75855)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Dec 18 13:12:38 PST 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 363f708fcbf92299f4defa8057b8d38a61f168d0 898b3b05960cecc32c1c4e15be4278c4f01ee22a -- mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
index 39bf5fb07f..5a1bc1cdb4 100644
--- a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
+++ b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
@@ -595,8 +595,7 @@ struct PrepareTransferReadConversion
     auto *newXfer = rewriter.clone(*xferOp.getOperation());
     newXfer->setAttr(kPassLabel, rewriter.getUnitAttr());
     if (xferOp.getMask()) {
-      cast<TransferReadOp>(newXfer).getMaskMutable().assign(
-          buffers.maskBuffer);
+      cast<TransferReadOp>(newXfer).getMaskMutable().assign(buffers.maskBuffer);
     }
 
     Location loc = xferOp.getLoc();
@@ -724,15 +723,12 @@ struct DecomposePrintOpConversion : public VectorToSCFPattern<vector::PrintOp> {
       VectorType signlessTarget =
           vectorType.cloneWith({}, getIntTypeWithSignlessSemantics(legalIntTy));
       VectorType target = vectorType.cloneWith({}, legalIntTy);
-      value = rewriter.create<vector::BitCastOp>(loc, signlessSource,
-                                                 value);
+      value = rewriter.create<vector::BitCastOp>(loc, signlessSource, value);
       if (value.getType() != signlessTarget) {
         if (width == 1 || intTy.isUnsigned())
-          value = rewriter.create<arith::ExtUIOp>(loc, signlessTarget,
-                                                  value);
+          value = rewriter.create<arith::ExtUIOp>(loc, signlessTarget, value);
         else
-          value = rewriter.create<arith::ExtSIOp>(loc, signlessTarget,
-                                                  value);
+          value = rewriter.create<arith::ExtSIOp>(loc, signlessTarget, value);
       }
       value = rewriter.create<vector::BitCastOp>(loc, target, value);
       vectorType = target;
@@ -749,7 +745,7 @@ struct DecomposePrintOpConversion : public VectorToSCFPattern<vector::PrintOp> {
       // non-constant value (which can currently only be done via
       // vector.extractelement for 1D vectors).
       int flatLength = std::accumulate(shape.begin(), shape.end(), 1,
-                                        std::multiplies<int64_t>());
+                                       std::multiplies<int64_t>());
       VectorType flat =
           VectorType::get({flatLength}, vectorType.getElementType());
       value = rewriter.create<vector::ShapeCastOp>(loc, flat, value);

``````````

</details>


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


More information about the Mlir-commits mailing list