##replace
Basic block instructions

Prev:##reload
Next:##replace-imm

Vocabulary
compiler.cfg.instructions

Class description
Copies a value from a machine register to a stack location.

See also
##peek, ##replace-imm

DefinitionMethods
USING: accessors compiler.cfg.gvn.avail
compiler.cfg.instructions kernel ;
M: ##replace >avail-insn-uses
[ dup >avail-vreg swap or ] change-src drop ;

USING: accessors compiler.cfg.instructions
compiler.cfg.linear-scan.assignment kernel ;
M: ##replace assign-insn-uses [ vreg>reg ] change-src drop ;

USING: accessors compiler.cfg.instructions
compiler.cfg.representations.rewrite kernel ;
M: ##replace convert-insn-uses
[ converted-value ] change-src drop ;

USING: accessors compiler.cfg.instructions compiler.codegen
cpu.architecture kernel ;
M: ##replace generate-insn
[ src>> ] keep [ loc>> ] keep drop %replace ;

USING: accessors compiler.cfg.instructions compiler.cfg.renaming
kernel ;
M: ##replace rename-insn-uses [ rename-value ] change-src drop ;

USING: accessors compiler.cfg.gvn.graph compiler.cfg.gvn.rewrite
compiler.cfg.instructions cpu.architecture kernel ;
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 ;

USING: accessors compiler.cfg.instructions
compiler.cfg.value-numbering.graph
compiler.cfg.value-numbering.rewrite cpu.architecture kernel ;
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 ;

USING: accessors compiler.cfg.instructions
compiler.cfg.ssa.construction.private kernel ;
M: ##replace ssa-rename-insn-uses [ top-name ] change-src drop ;

USING: compiler.cfg.instructions
compiler.cfg.representations.preferred cpu.architecture kernel ;
M: ##replace uses-vreg-reps drop { tagged-rep } ;

USING: accessors arrays compiler.cfg.def-use
compiler.cfg.instructions ;
M: ##replace uses-vregs src>> 1array ;

USING: compiler.cfg.instructions compiler.cfg.stacks.padding ;
M: ##replace visit-insn live-location ;