Commit 18bfa29
⚡ Bolt: Optimize IR block predecessor mapping from O(N^2) to O(N)
This replaces the inner loop `.contains()` check with an O(N)
adjacency list constructed via a `HashMap`, drastically improving
compilation times for modules with large numbers of basic blocks.
Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>1 parent 4c273b1 commit 18bfa29
2 files changed
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
273 | 270 | | |
274 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
0 commit comments