 ! These need to be numbered so that the same instruction
 ! will get distinct nodes if it occurs multiple times
 TUPLE: node
+    precedes-data precedes-control
     number insn precedes follows
     children parent
     registers parent-index ;

USING: accessors assocs combinators compiler.cfg.def-use
compiler.cfg.instructions compiler.cfg.registers fry kernel
locals namespaces sequences sets sorting math.vectors
make math combinators.short-circuit ;
IN: compiler.cfg.dependence

! Dependence graph construction

        [ set-roots ]
    } cleave ;

! Constructing fan-in trees using the
! Sethi-Ulmann numbering

:: calculate-registers ( node -- registers )
    node children>> [ 0 ] [
        [ [ calculate-registers ] map natural-sort ]
