[Mlir-commits] [mlir] [mlir][Tosa] Handle empty block-scaled reshape shapes (PR #220872)

Luke Hutton llvmlistbot at llvm.org
Thu Sep 3 05:22:49 PDT 2026


================
@@ -3203,7 +3204,8 @@ LogicalResult tosa::ReshapeBlockScaledOp::inferReturnTypeComponents(
     for (size_t idx = 0; idx < newShapeValue.size(); idx++) {
       if (ShapedType::isDynamic(newScaleShapeValue[idx])) {
         newScaleShapeValue[idx] = newShapeValue[idx];
-        if (idx == (newShapeValue.size() - 1))
+        if (idx + 1 == newShapeValue.size() &&
+            ShapedType::isStatic(newScaleShapeValue[idx]))
----------------
lhutton1 wrote:

I don't think the static check is required here due to L3206 above. newShapeValue must not have dynamic shapes associated with it as it is a shape_t input value

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


More information about the Mlir-commits mailing list