]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg: Fix conflicts after merging local optimization refactoring into DCN...
authorSlava Pestov <slava@shill.local>
Wed, 22 Jul 2009 08:17:53 +0000 (03:17 -0500)
committerSlava Pestov <slava@shill.local>
Wed, 22 Jul 2009 08:17:53 +0000 (03:17 -0500)
1  2 
basis/compiler/cfg/checker/checker.factor
basis/compiler/cfg/def-use/def-use.factor
basis/compiler/cfg/optimizer/optimizer.factor

index f9f5211c9c865e0b39a5c532fa93f75e5af1b221,2f8077be99df79fb8fb3cfdff7cabf476f4617bb..60b8ed41184f10e6c118f0be6fec0039a7ecdf32
@@@ -1,22 -1,14 +1,21 @@@
  ! Copyright (C) 2009 Slava Pestov.
  ! See http://factorcode.org/license.txt for BSD license.
- USING: kernel combinators.short-circuit accessors math sequences sets
- assocs compiler.cfg.instructions compiler.cfg.rpo compiler.cfg.def-use
- compiler.cfg.linearization compiler.cfg.liveness
- compiler.cfg.utilities ;
+ USING: kernel compiler.cfg.instructions compiler.cfg.rpo
 -compiler.cfg.def-use compiler.cfg.linearization
++compiler.cfg.def-use compiler.cfg.linearization compiler.cfg.utilities
+ combinators.short-circuit accessors math sequences sets assocs ;
  IN: compiler.cfg.checker
  
 -ERROR: last-insn-not-a-jump insn ;
 +ERROR: bad-kill-block bb ;
 +
 +: check-kill-block ( bb -- )
 +    dup instructions>> first2
 +    swap ##epilogue? [ [ ##return? ] [ ##callback-return? ] bi or ] [ ##branch? ] if
 +    [ drop ] [ bad-kill-block ] if ;
 +
 +ERROR: last-insn-not-a-jump bb ;
  
  : check-last-instruction ( bb -- )
 -    last dup {
 +    dup instructions>> last {
          [ ##branch? ]
          [ ##dispatch? ]
          [ ##conditional-branch? ]
index 2aa55df9118baf86c913946380774a29b1e5b957,d7bfc56b3213fdd09eef767c6d4a5087b2654365..1c52c081a152f53822bf60b27c8fe1877d6a8529
@@@ -48,3 -48,27 +49,12 @@@ M: _conditional-branch uses-vregs [ src
  M: _compare-imm-branch uses-vregs src1>> 1array ;
  M: _dispatch uses-vregs src>> 1array ;
  M: insn uses-vregs drop f ;
 -! Instructions that use vregs
 -UNION: vreg-insn
 -##flushable
 -##write-barrier
 -##dispatch
 -##effect
 -##fixnum-overflow
 -##conditional-branch
 -##compare-imm-branch
 -##phi
 -##gc
 -_conditional-branch
 -_compare-imm-branch
 -_dispatch ;
 -
+ : map-unique ( seq quot -- assoc )
+     map concat unique ; inline
+ : gen-set ( instructions -- seq )
+     [ uses-vregs ] map-unique ;
+ : kill-set ( instructions -- seq )
+     [ defs-vregs ] map-unique ;
index ac6dcbc5030f851368c7c174c5f3780b3930cf53,50148b73b2bb12e890cdb551a50855881cdb2544..af73fd942002252409e0abfc5a4c96a892f59d56
@@@ -36,10 -33,7 +35,9 @@@ SYMBOL: check-optimizer
          split-branches
          join-blocks
          compute-predecessors
 -        stack-analysis
 +        deconcatenatize
 +        compute-dominance
 +        construct-ssa
-         compute-liveness
          alias-analysis
          value-numbering
          compute-predecessors