]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.gvn.avail: minor simplification
authorAlex Vondrak <ajvondrak@csupomona.edu>
Mon, 27 Jun 2011 22:12:07 +0000 (15:12 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 12 Sep 2012 22:14:08 +0000 (15:14 -0700)
extra/compiler/cfg/gvn/avail/avail.factor

index 9c0b4ab2f048460bf10b1cc458ab1922bf5530ef..e0f7926c4dfb3aff86abd97dc1cfd564c9259609 100644 (file)
@@ -1,18 +1,18 @@
 ! Copyright (C) 2011 Alex Vondrak.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs compiler.cfg
-compiler.cfg.dataflow-analysis compiler.cfg.def-use hashtables
-kernel namespaces sequences ;
+compiler.cfg.dataflow-analysis
+compiler.cfg.def-use
+compiler.cfg.predecessors compiler.cfg.rpo deques dlists
+hashtables kernel locals namespaces sequences sets ;
+FROM: namespaces => set ;
 IN: compiler.cfg.gvn.avail
 
-! assoc mapping basic blocks to the set of value numbers that
-! are defined in the block
-SYMBOL: bbs>defns
-
-! : defined ( bb -- vns ) bbs>defns get at ;
-
 : defined ( bb -- vregs )
-    instructions>> [ defs-vregs ] map concat [ dup ] H{ } map>assoc ;
+    instructions>> [ defs-vregs ] map concat unique ;
+
+! This doesn't propagate across "kill blocks".  Not sure if
+! that's right, though I may as well assume as much.
 
 FORWARD-ANALYSIS: avail