2010-05-01 03:04:31 -04:00
|
|
|
! Copyright (C) 2010 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2010-05-03 17:23:03 -04:00
|
|
|
USING: accessors cpu.architecture kernel
|
|
|
|
compiler.cfg.instructions
|
2010-05-01 03:04:31 -04:00
|
|
|
compiler.cfg.value-numbering.graph
|
2010-05-03 17:23:03 -04:00
|
|
|
compiler.cfg.value-numbering.rewrite ;
|
2010-05-01 03:04:31 -04:00
|
|
|
IN: compiler.cfg.value-numbering.misc
|
|
|
|
|
|
|
|
M: ##replace rewrite
|
2010-05-03 17:23:03 -04:00
|
|
|
[ loc>> ] [ src>> vreg>insn ] bi
|
|
|
|
dup literal-insn? [
|
|
|
|
insn>literal dup immediate-store?
|
2011-11-13 01:04:26 -05:00
|
|
|
[ swap ##replace-imm new-insn ] [ 2drop f ] if
|
2010-05-03 17:23:03 -04:00
|
|
|
] [ 2drop f ] if ;
|