Fix optimizer regression

db4
Slava Pestov 2008-01-27 18:15:11 -04:00
parent 1c91a286e5
commit b60edc199a
2 changed files with 11 additions and 3 deletions

View File

@ -287,3 +287,7 @@ TUPLE: silly-tuple a b ;
[ 3 throw ] [ empty-compound ] compose [ 3 throw ] if ;
[ t ] [ \ node-successor-f-bug compiled? ] unit-test
: construct-empty-bug construct-empty ;
[ ] [ [ construct-empty ] dataflow optimize drop ] unit-test

View File

@ -2,7 +2,8 @@
! See http://factorcode.org/license.txt for BSD license.
USING: arrays generic assocs hashtables inference kernel
math namespaces sequences words parser math.intervals
effects classes inference.dataflow inference.backend ;
effects classes inference.dataflow inference.backend
combinators ;
IN: inference.class
! Class inference
@ -181,8 +182,11 @@ M: pair constraint-satisfied?
] if* ;
: default-output-classes ( word -- classes )
"inferred-effect" word-prop effect-out
dup [ class? ] all? [ drop f ] unless ;
"inferred-effect" word-prop {
{ [ dup not ] [ drop f ] }
{ [ dup effect-out [ class? ] all? not ] [ drop f ] }
{ [ t ] [ effect-out ] }
} cond ;
: compute-output-classes ( node word -- classes intervals )
dup node-param "output-classes" word-prop dup