[Mlir-commits] [mlir] [mlir][tosa] Check for 0-ranked-tensors during fold (PR #68512)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Oct 8 01:54:33 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 b8f70feaeff075b998f42c9ac54f8ee330cc0a6e 4a9fc20c13a445403057a7741aa94ee5a0b871ae -- mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
index d1182b324..f8b3b9732 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
@@ -874,7 +874,8 @@ OpFoldResult ReverseOp::fold(FoldAdaptor adaptor) {
     return operandAttr;
 
   // If the dim-length is 1, tosa.reverse is a no-op.
-  if (operandTy.hasRank() && operandTy.getRank() != 0 && operandTy.getDimSize(axis) == 1)
+  if (operandTy.hasRank() && operandTy.getRank() != 0 &&
+      operandTy.getDimSize(axis) == 1)
     return operand;
 
   return {};

``````````

</details>


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


More information about the Mlir-commits mailing list