[llvm] [GenericDomTreeConstruction] Use 0-based DFS numbering (PR #207524)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 08:01:05 PDT 2026


MaskRay wrote:

Thanks! No instructions:u significance, with a minuscule size-text decrease, as expected https://llvm-compile-time-tracker.com/compare.php?from=f2342e84e66c015a43437620f825fe884c8bdd4e&to=3c447748ce9f2aa98179c15d19b79e4f4b6c4ba9&stat=instructions:u

On removing the sentinel from `ReverseChildren`
```
  runDFS store

  eliminates a decrease from the sentinel:  ff c8   dec eax   (2B, no counterpart in no-sentinel)

  runSemiNCA read loop (dom and pdom — byte-identical pattern in both)

  no-sentinel                              sentinel
  41 ff cf   dec    r15d          (3B)      44 89 f9   mov    ecx, r15d        (3B)
  49 8b 8c.. mov    rcx,[r12+520] (8B)      49 8b 94.. mov    rdx,[r12+520]    (8B)
  42 8b 14f9 mov    edx,[rcx+8*r15]  (4B)   8b 34 ca   mov    esi,[rdx+8*rcx]  (3B)
  46 8b7cf904 mov  r15d,[rcx+8*r15+4](5B)   44 8b7cca04 mov  r15d,[rdx+8*rcx+4](5B)
  49 8b6cd500 mov  rbp,[r13+8*rdx]  (5B)    49 8b6cf500 mov  rbp,[r13+8*rsi]  (5B)
                                    27B                                        24B...

  Totals: no-sentinel = 3+8+4+5+5 = 25B, sentinel = 3+8+3+5+5 = 24B. Sentinel is 1 byte smaller here.
```

https://github.com/llvm/llvm-project/pull/207524


More information about the llvm-commits mailing list