[Mlir-commits] [mlir] [mlir][tosa] Change the start and size of slice to tosa shape type (PR #124209)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jan 24 16:26:09 PST 2025
================
@@ -891,8 +891,18 @@ LogicalResult tosa::SliceOp::inferReturnTypeComponents(
MLIRContext *context, ::std::optional<Location> location,
SliceOp::Adaptor adaptor,
SmallVectorImpl<ShapedTypeComponents> &inferredReturnShapes) {
- auto start = adaptor.getStart();
- auto size = adaptor.getSize();
+
+ Type inputType = getElementTypeOrSelf(adaptor.getInput1().getType());
+ SmallVector<int64_t> start;
+ SmallVector<int64_t> size;
+
+ if (!tosa::getConstShapeValue(adaptor.getStart().getDefiningOp(), start) ||
----------------
Jerry-Ge wrote:
Thanks for the clarification. I don't have a strong opinion. cc original author @Tai78641 here
If we change the return type to `std::optional<SmallVector<int64_t>`, there will be extra code to check if the function is working or not. So we won't save too much lines of code here.
And we also need to update other usages of this function which will incur more upstreaming effort (conflicts) .
So, the ROI will not be high.
https://github.com/llvm/llvm-project/pull/124209
More information about the Mlir-commits
mailing list