[Mlir-commits] [mlir] [mlir][tosa] Enhance TosaInferShapes pass for simple shape inference (PR #178418)
Sayan Saha
llvmlistbot at llvm.org
Thu Feb 5 05:18:55 PST 2026
sahas3 wrote:
> Thanks both, I have taken a look at pulling "convert-function-boundaries" into a separate isolated pass and think, at least for now, I'd prefer to keep things as is. There are some differences between the way "tosa-infer-shapes" / "tosa-narrow-i64-to-i32" passes insert casts which make it a not so straight forward refactor, e.g.:
>
> * inserts tensor.cast operations / inserts tosa.cast operations
>
> * inserts casts only at the return boundary / inserts casts at both input and return boundary
>
>
> To help avoid the possibility of introducing bugs, I'd like to see if this pattern comes up more frequently and consider refactoring at a later stage. I hope this seems reasonable?
Okay, I see the cast ops are fundamentally different. `tensor.cast` is needed for shape changes for `tosa-infer-shapes` but for the other transform since it only changes datatypes, `tosa.cast` is required.
I am fine with deferring the refactor work to later as suggested.
https://github.com/llvm/llvm-project/pull/178418
More information about the Mlir-commits
mailing list