Commit 7f7961e
committed
Validate operand type widths in emission to reject cross-width unification
The egraph uses IntExpr/FloatExpr sorts that don't distinguish SPIR-V
type widths, so i32 and i64 values can share e-classes. When extraction
picks a mismatched-width operand, the emitted instruction would violate
SPIR-V type rules (e.g. ShiftRightLogical with i32 base but i64 result).
Bail out of emission when operand width differs from result width for
same-class operations, causing the extraction loop to keep the original
instruction.1 parent 26e35d6 commit 7f7961e
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1270 | 1288 | | |
1271 | 1289 | | |
1272 | 1290 | | |
| |||
0 commit comments