[llvm] [mlir] [TOSA] Add Tosa_Shape type and ConstShapeOp (PR #122547)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 15:11:54 PST 2025


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 749bdc87f5d0646be93bb90dd843ffa07924205e 4360edfc421f6588ae50e2437330917b205f5517 --extensions cpp,h -- mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp mlir/lib/Dialect/Tosa/IR/TosaOps.cpp mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
index f00cb4c282..9bc9509924 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
@@ -101,7 +101,6 @@ public:
   }
 };
 
-
 LogicalResult verifyTosaShapeOperator(Operation *op);
 /// This class indicates that op operates on tosa shape types
 template <typename ConcreteType>
@@ -112,7 +111,6 @@ public:
   }
 };
 
-
 LogicalResult verifyTosaShapeOperatorWithSameRanks(Operation *op);
 /// This class indicates that op operates on tosa shape types
 template <typename ConcreteType>
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index 3354f6908c..46400d7495 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -990,7 +990,6 @@ LogicalResult tosa::TileOp::inferReturnTypeComponents(
   if (!matchPattern(adaptor.getMultiples(), m_Constant(&multiplesAttr)))
     return failure();
 
-
   // ArrayRef<int64_t> multiples = adaptor.getMultiples();
   SmallVector<int64_t> multiples = llvm::to_vector(
       llvm::map_range(multiplesAttr.getValues<APInt>(),
diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index 7c834cbff0..a49870687f 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -537,7 +537,7 @@ bool TosaValidation::isValidElementType(Type type) {
       }
     }
   } else if (mlir::isa<tosa::shapeType>(type)) {
-      return true;
+    return true;
   }
   return false;
 }

``````````

</details>


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


More information about the llvm-commits mailing list