Move insn class to compiler.cfg.instructions
parent
1912c57bb5
commit
492a15e345
|
@ -3,7 +3,7 @@
|
||||||
USING: kernel math namespaces assocs hashtables sequences
|
USING: kernel math namespaces assocs hashtables sequences
|
||||||
accessors vectors combinators sets classes compiler.cfg
|
accessors vectors combinators sets classes compiler.cfg
|
||||||
compiler.cfg.registers compiler.cfg.instructions
|
compiler.cfg.registers compiler.cfg.instructions
|
||||||
compiler.cfg.instructions.syntax compiler.cfg.copy-prop ;
|
compiler.cfg.copy-prop ;
|
||||||
IN: compiler.cfg.alias-analysis
|
IN: compiler.cfg.alias-analysis
|
||||||
|
|
||||||
! Alias analysis -- assumes compiler.cfg.height has already run.
|
! Alias analysis -- assumes compiler.cfg.height has already run.
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs sets kernel namespaces sequences
|
USING: accessors assocs sets kernel namespaces sequences
|
||||||
compiler.cfg.instructions compiler.cfg.instructions.syntax
|
compiler.cfg.instructions compiler.cfg.def-use ;
|
||||||
compiler.cfg.def-use ;
|
|
||||||
IN: compiler.cfg.dead-code
|
IN: compiler.cfg.dead-code
|
||||||
|
|
||||||
! Dead code elimination -- assumes compiler.cfg.alias-analysis
|
! Dead code elimination -- assumes compiler.cfg.alias-analysis
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays kernel compiler.cfg.instructions
|
USING: accessors arrays kernel compiler.cfg.instructions ;
|
||||||
compiler.cfg.instructions.syntax ;
|
|
||||||
IN: compiler.cfg.def-use
|
IN: compiler.cfg.def-use
|
||||||
|
|
||||||
GENERIC: defs-vregs ( insn -- seq )
|
GENERIC: defs-vregs ( insn -- seq )
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors math namespaces sequences kernel fry
|
USING: accessors math namespaces sequences kernel fry
|
||||||
compiler.cfg compiler.cfg.registers compiler.cfg.instructions
|
compiler.cfg compiler.cfg.registers compiler.cfg.instructions ;
|
||||||
compiler.cfg.instructions.syntax ;
|
|
||||||
IN: compiler.cfg.height
|
IN: compiler.cfg.height
|
||||||
|
|
||||||
! Combine multiple stack height changes into one at the
|
! Combine multiple stack height changes into one at the
|
||||||
|
|
|
@ -7,6 +7,7 @@ compiler.cfg.instructions.syntax ;
|
||||||
IN: compiler.cfg.instructions
|
IN: compiler.cfg.instructions
|
||||||
|
|
||||||
! Virtual CPU instructions, used by CFG and machine IRs
|
! Virtual CPU instructions, used by CFG and machine IRs
|
||||||
|
TUPLE: insn ;
|
||||||
|
|
||||||
! Instruction with no side effects; if 'out' is never read, we
|
! Instruction with no side effects; if 'out' is never read, we
|
||||||
! can eliminate it.
|
! can eliminate it.
|
||||||
|
|
|
@ -4,11 +4,15 @@ USING: classes.tuple classes.tuple.parser kernel words
|
||||||
make fry sequences parser ;
|
make fry sequences parser ;
|
||||||
IN: compiler.cfg.instructions.syntax
|
IN: compiler.cfg.instructions.syntax
|
||||||
|
|
||||||
TUPLE: insn ;
|
: insn-word ( -- word )
|
||||||
|
#! We want to put the insn tuple in compiler.cfg.instructions,
|
||||||
|
#! but we cannot have circularity between that vocabulary and
|
||||||
|
#! this one.
|
||||||
|
"insn" "compiler.cfg.instructions" lookup ;
|
||||||
|
|
||||||
: INSN:
|
: INSN:
|
||||||
parse-tuple-definition "regs" suffix
|
parse-tuple-definition "regs" suffix
|
||||||
[ dup tuple eq? [ drop insn ] when ] dip
|
[ dup tuple eq? [ drop insn-word ] when ] dip
|
||||||
[ define-tuple-class ]
|
[ define-tuple-class ]
|
||||||
[ 2drop save-location ]
|
[ 2drop save-location ]
|
||||||
[ 2drop dup '[ f _ boa , ] define-inline ]
|
[ 2drop dup '[ f _ boa , ] define-inline ]
|
||||||
|
|
|
@ -4,8 +4,7 @@ USING: kernel math accessors sequences namespaces make
|
||||||
combinators
|
combinators
|
||||||
compiler.cfg
|
compiler.cfg
|
||||||
compiler.cfg.rpo
|
compiler.cfg.rpo
|
||||||
compiler.cfg.instructions
|
compiler.cfg.instructions ;
|
||||||
compiler.cfg.instructions.syntax ;
|
|
||||||
IN: compiler.cfg.linearization
|
IN: compiler.cfg.linearization
|
||||||
|
|
||||||
! Convert CFG IR to machine IR.
|
! Convert CFG IR to machine IR.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: namespaces accessors math.order assocs kernel sequences
|
USING: namespaces accessors math.order assocs kernel sequences
|
||||||
combinators make cpu.architecture compiler.cfg.instructions
|
combinators make cpu.architecture compiler.cfg.instructions
|
||||||
compiler.cfg.instructions.syntax compiler.cfg.registers ;
|
compiler.cfg.registers ;
|
||||||
IN: compiler.cfg.stack-frame
|
IN: compiler.cfg.stack-frame
|
||||||
|
|
||||||
SYMBOL: frame-required?
|
SYMBOL: frame-required?
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: namespaces assocs sequences kernel accessors
|
USING: namespaces assocs sequences kernel accessors
|
||||||
compiler.cfg.instructions compiler.cfg.instructions.syntax
|
compiler.cfg.instructions compiler.cfg.value-numbering.graph ;
|
||||||
compiler.cfg.value-numbering.graph ;
|
|
||||||
IN: compiler.cfg.value-numbering.propagate
|
IN: compiler.cfg.value-numbering.propagate
|
||||||
|
|
||||||
! If two vregs compute the same value, replace references to
|
! If two vregs compute the same value, replace references to
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
USING: kernel sequences layouts accessors combinators namespaces
|
USING: kernel sequences layouts accessors combinators namespaces
|
||||||
math
|
math
|
||||||
compiler.cfg.instructions
|
compiler.cfg.instructions
|
||||||
compiler.cfg.instructions.syntax
|
|
||||||
compiler.cfg.value-numbering.graph
|
compiler.cfg.value-numbering.graph
|
||||||
compiler.cfg.value-numbering.simplify
|
compiler.cfg.value-numbering.simplify
|
||||||
compiler.cfg.value-numbering.expressions ;
|
compiler.cfg.value-numbering.expressions ;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel accessors combinators classes math layouts
|
USING: kernel accessors combinators classes math layouts
|
||||||
compiler.cfg.instructions
|
compiler.cfg.instructions
|
||||||
compiler.cfg.instructions.syntax
|
|
||||||
compiler.cfg.value-numbering.graph
|
compiler.cfg.value-numbering.graph
|
||||||
compiler.cfg.value-numbering.expressions ;
|
compiler.cfg.value-numbering.expressions ;
|
||||||
IN: compiler.cfg.value-numbering.simplify
|
IN: compiler.cfg.value-numbering.simplify
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel accessors namespaces assocs sets sequences locals
|
USING: kernel accessors namespaces assocs sets sequences locals
|
||||||
compiler.cfg compiler.cfg.instructions
|
compiler.cfg compiler.cfg.instructions compiler.cfg.copy-prop ;
|
||||||
compiler.cfg.instructions.syntax compiler.cfg.copy-prop ;
|
|
||||||
IN: compiler.cfg.write-barrier
|
IN: compiler.cfg.write-barrier
|
||||||
|
|
||||||
! Eliminate redundant write barrier hits.
|
! Eliminate redundant write barrier hits.
|
||||||
|
|
Loading…
Reference in New Issue