2011-05-22 20:15:56 -04:00
|
|
|
! Copyright (C) 2010 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2011-09-08 12:57:40 -04:00
|
|
|
USING: accessors cpu.architecture kernel
|
2011-05-22 20:15:56 -04:00
|
|
|
compiler.cfg.instructions
|
2011-06-14 15:04:58 -04:00
|
|
|
compiler.cfg.utilities
|
2011-05-22 20:15:56 -04:00
|
|
|
compiler.cfg.gvn.graph
|
|
|
|
compiler.cfg.gvn.rewrite ;
|
|
|
|
IN: compiler.cfg.gvn.misc
|
|
|
|
|
|
|
|
M: ##replace rewrite
|
|
|
|
[ loc>> ] [ src>> vreg>insn ] bi
|
|
|
|
dup literal-insn? [
|
|
|
|
insn>literal dup immediate-store?
|
2012-08-02 19:41:23 -04:00
|
|
|
[ swap ##replace-imm new-insn ] [ 2drop f ] if
|
2011-05-22 20:15:56 -04:00
|
|
|
] [ 2drop f ] if ;
|