Commit 78f67c7
committed
Fix Op::Constant with boolean result type emitting wrong sort
Some SPIR-V compilers emit OpConstant (instead of OpConstantTrue/
OpConstantFalse) for boolean values. The parser only checked for
float vs integer, so bool constants fell through to the integer
branch and produced (Const N) instead of (BoolConst N). This caused
egglog sort mismatches when the value was later used in boolean
operations expecting BoolExpr.
Check TypeClass::Bool before the float/integer branches so boolean
OpConstant values emit (BoolConst 0/1) in the correct BoolExpr sort.1 parent b8a5f5d commit 78f67c7
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
176 | 184 | | |
177 | 185 | | |
178 | 186 | | |
| |||
0 commit comments