don't propagate pure primcalls that might not type-check
authorAndy Wingo <wingo@pobox.com>
Tue, 27 Sep 2011 21:20:49 +0000 (23:20 +0200)
committerAndy Wingo <wingo@pobox.com>
Tue, 27 Sep 2011 22:13:56 +0000 (00:13 +0200)
commitfc283c92cbdb31942f033541b52376fd1bade3f2
treeae63992fb5af9063328d3959160660b1fbc30c48
parentb5ae223d129b427e2b5695c82c45f16995f36236
don't propagate pure primcalls that might not type-check

* module/language/tree-il/optimize.scm (types-check?): New helper, to
  determine if a primcall will apply without throwing an exception.
  (peval): constant-expression? returns #f for expressions that don't
  types-check?.  Effect-free primitives that type-check are void.
module/language/tree-il/optimize.scm
test-suite/tests/tree-il.test