Commit bde336e
authored
Update tosa.mul op in StableHLO-to-TOSA Pass in compliance with MLIR upstream and TOSA-v1.0 (#2702)
This PR updates the StableHLO to TOSA legalization pass to align with
the recent changes in the MLIR upstream. Specifically,
[the `tosa::MulOp` operation has being modified to comply with the
TOSA-v1.0
specification](llvm/llvm-project#121953). The
shift parameter of the MUL operator, which was previously an attribute,
has been moved to an SSA operand.
The upstream changes caused a compilation failure in the StableHLO to
TOSA conversion pass because the `tosa.mul` operation now expects 3
operand groups instead of 2, as reflected in the error message:
```jsx
error: invalid number of operand groups for `tosa.mul`; expected 3, but got 2
with op<tosa.mul>(input0, input1) {shift = attr<"0 : i8">};
^
```
This PR added a zero constant as the additional argument for the shift
parameter to maintain compatibility with the updated `tosa.mul`
operation.1 parent b62dc66 commit bde336e
File tree
2 files changed
+10
-2
lines changed- build_tools
- stablehlo/conversions/tosa/transforms
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
140 | | - | |
| 148 | + | |
141 | 149 | | |
142 | 150 | | |
143 | 151 | | |
| |||
0 commit comments