[Mlir-commits] [mlir] [mlir][tosa] Change the start and size of slice to tosa shape type (PR #124209)

TatWai Chong llvmlistbot at llvm.org
Mon Jan 27 11:32:29 PST 2025


================
@@ -268,12 +268,28 @@ class SliceConverter : public OpConversionPattern<tosa::SliceOp> {
     ShapedType resultType = cast<ShapedType>(sliceOp.getType());
     if (llvm::isa<UnrankedTensorType>(resultType))
       return failure();
+
+    ElementsAttr StartElems;
+    ElementsAttr SizeElems;
+
+    if (!matchPattern(sliceOp.getStart(), m_Constant(&StartElems)))
----------------
tatwaichong wrote:

Sorry, I don't get this question? Can you expand on it?
`tosa-to-tensor-invalid.mlir` and `tosa-to-tensor.mlir` have lowering tosa.slice to tensor ops. I think we have to adjust the tosa-to-tensor conversion and its lit tests when the argument types of tosa.slice are changed, and do it in the same patch.

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


More information about the Mlir-commits mailing list