! Copyright (C) 2009, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors assocs fry kernel namespaces sequences math arrays compiler.cfg.def-use compiler.cfg.instructions compiler.cfg.liveness.ssa compiler.cfg.rpo compiler.cfg.dominance compiler.cfg ; IN: compiler.cfg.ssa.interference.live-ranges ! Live ranges for interference testing > [ swap record-insn ] each-index ] [ [ local-def-indices get ] dip def-indices get set-at ] [ [ local-kill-indices get ] dip kill-indices get set-at ] tri ; PRIVATE> : compute-live-ranges ( cfg -- ) needs-dominance H{ } clone def-indices set H{ } clone kill-indices set [ compute-local-live-ranges ] each-basic-block ; : def-index ( vreg bb -- n ) def-indices get at at ; ERROR: bad-kill-index vreg bb ; : kill-index ( vreg bb -- n ) 2dup live-out? [ 2drop 1/0. ] [ 2dup kill-indices get at at* [ 2nip ] [ drop 2dup live-in? [ bad-kill-index ] [ 2drop -1/0. ] if ] if ] if ;