-! 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? [