minor SSA liveness code reorganization
parent
cf7ab59fb7
commit
3b78d03e2a
|
@ -97,31 +97,15 @@ SYMBOL: phi-outs
|
||||||
H{ } T_q-sets set
|
H{ } T_q-sets set
|
||||||
[ next-T_q drop ] each-basic-block ;
|
[ next-T_q drop ] each-basic-block ;
|
||||||
|
|
||||||
:: compute-phi-uses ( cfg -- )
|
|
||||||
! Here, a phi node uses its argument in the block that it comes from.
|
|
||||||
H{ } clone :> use
|
|
||||||
cfg [| block |
|
|
||||||
block instructions>> [
|
|
||||||
dup ##phi?
|
|
||||||
[ inputs>> [ use conjoin-at ] assoc-each ]
|
|
||||||
[ uses-vregs [ block swap use conjoin-at ] each ]
|
|
||||||
if
|
|
||||||
] each
|
|
||||||
] each-basic-block
|
|
||||||
use [ keys ] assoc-map uses set ;
|
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: precompute-liveness ( cfg -- )
|
: precompute-liveness ( cfg -- )
|
||||||
! The first three of these depend only on the graph
|
! Maybe dominance and def-use should be called before this, separately
|
||||||
! structure of the CFG, and don't need to be recomputed
|
|
||||||
! if that doesn't change
|
|
||||||
{
|
{
|
||||||
|
[ compute-dominance ]
|
||||||
|
[ compute-def-use ]
|
||||||
[ compute-R_q ]
|
[ compute-R_q ]
|
||||||
[ compute-T_q ]
|
[ compute-T_q ]
|
||||||
[ compute-dominance ]
|
|
||||||
[ compute-defs ]
|
|
||||||
[ compute-phi-uses ]
|
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
Loading…
Reference in New Issue