Yuvaraj Venkatesh 9c606ae0c0
[MLIR][TOSA] Update IfOp print/parse to support ranked condition tens… (#149791)
…or and optional block arguments

This change extends the TOSA `cond_if` operation's print and parse logic
to handle the following:

- The condition operand may now have any rank, as long as the total
number of elements sums to 1.

  %1 = tosa.cond_if %0 : tensor<1x1x1xi1> -> tensor<4xf32>

- The `then` and `else` regions can now include optional block
arguments. The updated IR syntax reflects this:

%1 = tosa.cond_if %0 (%arg2 = %arg0, %arg3 = %arg1) : tensor<i1>
(tensor<4xf32>, tensor<4xf32>) -> tensor<4xf32>

- Removed parentheses around single result types in the printed
representation, aligning with the `AsmPrinter` conventions.

Co-authored-by: Luke Hutton <luke.hutton@arm.com>
2025-07-28 10:44:21 +01:00
..