Commit 3a14fa3
authored
refactor(cranelift): merge DominatorTreePreorder into DominatorTree (#11596)
* refactor(cranelift): merge DominatorTreePreorder into DominatorTree
Integrate preorder functionality directly into DominatorTree to
eliminate duplicate computation and improve performance.
This eliminates the need for a separate DominatorTreePreorder data
structure, reducing memory usage and providing O(1) block dominance
checks by default. Block dominance checks throughout the compiler now
benefit from constant-time performance instead of O(depth) tree
traversal.
* refactor(cranelift): implement the new unified DominatorTree
Remove separate DominatorTreePreorder computation and use unified API:
- Context: Remove domtree_preorder field, simplify compute_domtree()
- AliasAnalysis: Switch from DominatorTreePreorder to DominatorTree
- Update dominance checks to use general dominates() method
All dominance checks in alias analysis now automatically benefit from
O(1) block dominance performance when instructions are in different
blocks.
* refactor(cranelift): update optimization passes for DominatorTree
* refactor(cranelift): update verifier and tests for new DominatorTree
SSA dominance validation in the verifier now benefits from O(1)
block-to-block dominance checks, improving compilation performance
during debug builds with verification enabled.1 parent e017b7f commit 3a14fa3
File tree
8 files changed
+129
-247
lines changed- cranelift
- codegen/src
- egraph
- verifier
- filetests/src
8 files changed
+129
-247
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
| |||
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
82 | | - | |
83 | 78 | | |
84 | 79 | | |
85 | 80 | | |
| |||
319 | 314 | | |
320 | 315 | | |
321 | 316 | | |
322 | | - | |
323 | 317 | | |
324 | 318 | | |
325 | 319 | | |
| |||
349 | 343 | | |
350 | 344 | | |
351 | 345 | | |
352 | | - | |
| 346 | + | |
353 | 347 | | |
354 | 348 | | |
355 | 349 | | |
| |||
381 | 375 | | |
382 | 376 | | |
383 | 377 | | |
384 | | - | |
| 378 | + | |
385 | 379 | | |
386 | 380 | | |
387 | 381 | | |
| |||
0 commit comments