]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/compiler/cfg/gvn/misc/misc.factor
factor: trim using lists
[factor.git] / extra / compiler / cfg / gvn / misc / misc.factor
index 0a22cb15fb444223e9f0ff5395f9a51436ffc09a..584ab2750808f3bb0283651d5937f6ef5d4213a6 100644 (file)
@@ -1,23 +1,12 @@
 ! Copyright (C) 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs cpu.architecture grouping kernel
-sequences
-compiler.cfg.instructions
-compiler.cfg.utilities
-compiler.cfg.gvn.graph
-compiler.cfg.gvn.rewrite ;
+USING: accessors compiler.cfg.gvn.graph compiler.cfg.gvn.rewrite
+compiler.cfg.instructions cpu.architecture kernel ;
 IN: compiler.cfg.gvn.misc
 
 M: ##replace rewrite
     [ loc>> ] [ src>> vreg>insn ] bi
     dup literal-insn? [
         insn>literal dup immediate-store?
-        [ swap \ ##replace-imm new-insn ] [ 2drop f ] if
-    ] [ 2drop f ] if ;
-
-M: ##phi rewrite
-    [ dst>> ] [ inputs>> values [ vreg>canon-vn ] map sift ] bi
-    dup all-equal? [
-        [ drop f ]
-        [ first <copy> ] if-empty
+        [ swap ##replace-imm new-insn ] [ 2drop f ] if
     ] [ 2drop f ] if ;