dom.nx
buildroot/runtime/dom.nx
about
dom.nx -- Cooper-Harvey-Kennedy dominance, in NishiLang.
Ports the algorithm in dom.c to NishiLang. This is the first
module of the self-hosted compiler: pure graph operations on a
CFG, no dependency on ir.c's types. Future integration wraps this
so the rest of the compiler can call it.
Algorithm summary:
1. Reverse-postorder DFS from entry -> rpo[], rpo_num[].
2. Iterative dominators until fixed point (CHK 2001).
3. Dominance frontier via Cytron's closed-form walk.
4. Dominator-tree children table for pre-order walks.
dependencies 1 imports · 2 importers
imports: syscalls.nx
imported by: dom_test.nxsmoke_dom_inspect.nx
structs
| 23 | struct Block { |
consts
| none |
functions
| 41 | func rpo_dfs(blocks: *Block, b: i64, |
| 61 | func dom_intersect(blocks: *Block, b1: i64, b2: i64) -> i64 {
called by 1: dom_compute |
| 86 | func dom_compute(blocks: *Block, n_blocks: i64, entry: i64) -> i64 { |
| 188 | func df_compute(blocks: *Block, n_blocks: i64, |
| 275 | func loop_detect(blocks: *Block, n_blocks: i64, |