Commit 33561fc
committed
CFG-based loop body detection, remove Theta union, fix DCE used_ids
Three fixes for remaining CI difftest failures:
1. Loop body detection: Replace contiguous index range (header..merge)
with BFS from loop header following branch targets, stopping at the
merge block. SPIR-V does not guarantee contiguous block layout, so
the old range missed non-contiguous loop body blocks that should be
protected from RVSDG transformation. Fixes control_flow_complex.
2. Remove Theta-value union: The union of id{N} with Theta(true, id{N},
FConst(0.0)) puts the synthetic zero init value in the same e-class
as the actual computation, allowing the extractor to pick FConst(0.0)
instead of the real value. The Theta term still exists in the egraph
for LoopInvariant propagation without the union. Fixes math_ops.
3. DCE used_ids: Add operand references from types_global_values to
used_ids set. OpConstantComposite and other globals may reference IDs
that were aliased by the optimizer. Fixes matrix_ops undefined id.1 parent 3d85fc6 commit 33561fc
1 file changed
Lines changed: 50 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
232 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
233 | 260 | | |
234 | 261 | | |
235 | 262 | | |
| |||
467 | 494 | | |
468 | 495 | | |
469 | 496 | | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
476 | 503 | | |
477 | 504 | | |
478 | 505 | | |
| |||
1870 | 1897 | | |
1871 | 1898 | | |
1872 | 1899 | | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
1873 | 1908 | | |
1874 | 1909 | | |
1875 | 1910 | | |
| |||
0 commit comments