From ffe70b55e94a480d1eb644a5337040154d455d21 Mon Sep 17 00:00:00 2001 From: Alex Vondrak Date: Mon, 27 Jun 2011 15:43:24 -0700 Subject: [PATCH] delete compiler.cfg.gvn.redundancy-elimination --- .../gvn/redundancy-elimination/authors.txt | 1 - .../redundancy-elimination.factor | 61 ------------------- 2 files changed, 62 deletions(-) delete mode 100644 extra/compiler/cfg/gvn/redundancy-elimination/authors.txt delete mode 100644 extra/compiler/cfg/gvn/redundancy-elimination/redundancy-elimination.factor diff --git a/extra/compiler/cfg/gvn/redundancy-elimination/authors.txt b/extra/compiler/cfg/gvn/redundancy-elimination/authors.txt deleted file mode 100644 index 424d9aa409..0000000000 --- a/extra/compiler/cfg/gvn/redundancy-elimination/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Alex Vondrak diff --git a/extra/compiler/cfg/gvn/redundancy-elimination/redundancy-elimination.factor b/extra/compiler/cfg/gvn/redundancy-elimination/redundancy-elimination.factor deleted file mode 100644 index 1e31d16740..0000000000 --- a/extra/compiler/cfg/gvn/redundancy-elimination/redundancy-elimination.factor +++ /dev/null @@ -1,61 +0,0 @@ -! Copyright (C) 2011 Alex Vondrak. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs combinators.short-circuit -compiler.cfg.def-use compiler.cfg.gvn.avail -compiler.cfg.gvn.expressions compiler.cfg.gvn.graph -compiler.cfg.gvn.rewrite compiler.cfg.instructions -compiler.cfg.registers compiler.cfg.renaming.functor -compiler.cfg.rpo compiler.cfg.utilities kernel namespaces -sequences sequences.deep ; -IN: compiler.cfg.gvn.redundancy-elimination - -RENAMING: copy-prop [ vreg>vn ] [ vreg>vn ] [ drop next-vreg ] - -: copy-prop ( insn -- insn' ) - dup vreg-insn? [ dup copy-prop-insn-uses ] when ; - -GENERIC: update-insn ( insn -- insn/f ) - -: canonical-leader? ( vreg -- ? ) dup vreg>vn = ; - -: check-redundancy? ( insn -- ? ) - defs-vregs { - [ length 1 = ] - ! [ first canonical-leader? not ] - } 1&& ; - -: redundant? ( insn -- ? ) - ! [ dst>> ] [ >expr exprs>vns get at ] bi = not ; - >expr exprs>vns get key? ; - -: check-redundancy ( insn -- insn/f ) - dup check-redundancy? [ - dup redundant? - [ [ dst>> ] [ >expr exprs>vns get at ] bi ] - [ make-available ] if - ] when ; - -M: insn update-insn - dup rewrite [ update-insn ] [ check-redundancy ] ?if ; - -M: ##copy update-insn ; - -M: array update-insn [ update-insn ] map ; - -: (eliminate-redundancies) ( insns -- insns' ) - [ update-insn ] map flatten sift ; - -! USING: accessors io prettyprint compiler.cfg compiler.cfg.graphviz -! graphviz.render ; - -: eliminate-redundancies ( cfg -- ) - final-iteration? on - dup compute-avail-sets - [ - ! "Before:" print - ! avail-ins get [ [ number>> ] [ keys ] bi* ] assoc-map . - (eliminate-redundancies) - ! "After:" print - ! avail-ins get [ [ number>> ] [ keys ] bi* ] assoc-map . - ! cfg get cfgviz preview - ] simple-optimization ;