]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/compiler/cfg/gvn/slots/slots.factor
factor: trim using lists
[factor.git] / extra / compiler / cfg / gvn / slots / slots.factor
index 15a1040edd4c98551f8f2675dcb4fc46cfaa54dc..b61f531a173df27331395be838bce29320cbf8ee 100644 (file)
@@ -1,15 +1,16 @@
-! Copyright (C) 2010 Slava Pestov.
+! Copyright (C) 2010 Slava Pestov, 2011 Alex Vondrak.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators.short-circuit cpu.architecture fry
-kernel math
+USING: accessors cpu.architecture kernel math
 compiler.cfg.instructions
 compiler.cfg.gvn.graph
+compiler.cfg.gvn.avail
 compiler.cfg.gvn.rewrite ;
 IN: compiler.cfg.gvn.slots
 
 : simplify-slot-addressing? ( insn -- ? )
-    complex-addressing?
-    [ slot>> vreg>insn ##add-imm? ] [ drop f ] if ;
+    complex-addressing? [
+        slot>> vreg>insn [ ##add-imm? ] with-available-uses?
+    ] [ drop f ] if ;
 
 : simplify-slot-addressing ( insn -- insn/f )
     dup simplify-slot-addressing? [