compiler.cfg.gvn: with the change to vreg>vn, must check-redundancy on *any* insn that defs a vreg

db4
Alex Vondrak 2011-06-18 15:32:53 -07:00 committed by John Benediktsson
parent ad0a2e78b3
commit d6641eddb3
1 changed files with 1 additions and 8 deletions

View File

@ -36,9 +36,6 @@ GENERIC: process-instruction ( insn -- insn' )
[ redundant-instruction ] [ useful-instruction ] ?if ; [ redundant-instruction ] [ useful-instruction ] ?if ;
M: insn process-instruction M: insn process-instruction
dup rewrite [ process-instruction ] [ ] ?if ;
M: foldable-insn process-instruction
dup rewrite dup rewrite
[ process-instruction ] [ process-instruction ]
[ dup defs-vregs length 1 = [ check-redundancy ] when ] ?if ; [ dup defs-vregs length 1 = [ check-redundancy ] when ] ?if ;
@ -46,17 +43,13 @@ M: foldable-insn process-instruction
M: ##copy process-instruction M: ##copy process-instruction
dup [ src>> vreg>vn ] [ dst>> ] bi set-vn ; dup [ src>> vreg>vn ] [ dst>> ] bi set-vn ;
M: ##phi process-instruction
dup rewrite
[ process-instruction ] [ check-redundancy ] ?if ;
M: array process-instruction M: array process-instruction
[ process-instruction ] map ; [ process-instruction ] map ;
: value-numbering-step ( insns -- insns' ) : value-numbering-step ( insns -- insns' )
[ process-instruction ] map flatten ; [ process-instruction ] map flatten ;
! XXX there's going to be trouble with certain rewrites that ! FIXME there's going to be trouble with certain rewrites that
! modify the cfg / instructions destructively; namely those in ! modify the cfg / instructions destructively; namely those in
! comparisons.factor, alien.factor, and slots.factor ! comparisons.factor, alien.factor, and slots.factor