 : precedes ( first second -- )
     swap precedes>> conjoin ;
 
+: precedes-data ( first second -- )
+    [ precedes ]
+    [ swap precedes-data>> conjoin ] 2bi ;
+
+: precedes-control ( first second -- )
+    [ precedes ]
+    [ swap precedes-control>> conjoin ] 2bi ;
+
 :: add-data-edges ( nodes -- )
     ! This builds up def-use information on the fly, since
     ! we only care about local def-use
     H{ } clone :> definers
     nodes [| node |
         node insn>> defs-vreg [ node swap definers set-at ] when*
-        node insn>> uses-vregs [ definers at [ node precedes ] when* ] each
+        node insn>> uses-vregs [ definers at [ node precedes-data ] when* ] each
     ] each ;
 
 : make-chain ( nodes -- )
-    [ dup rest-slice [ precedes ] 2each ] unless-empty ;
+    [ dup rest-slice [ precedes-control ] 2each ] unless-empty ;
 
 : instruction-chain ( nodes quot -- )
     '[ insn>> @ ] filter make-chain ; inline

        [ set-roots ]
    } cleave ;

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

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 vectors ;
IN: compiler.cfg.dependence

! Dependence graph construction
