Fix Trac #5658: strict bindings not floated in
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 12 Jan 2012 17:17:22 +0000 (17:17 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 12 Jan 2012 17:18:18 +0000 (17:18 +0000)
commit3beb1a831b37f616b5e8092def2e51cd9825735f
tree33bcf8fc8200d4ac221bb5cfe5383436fec916ec
parent6496c6f1421c3890e7fe72823c29584e5200f3fd
Fix Trac #5658: strict bindings not floated in

Two changes here

* The main change here is to enhance the FloatIn pass so that it can
  float case-bindings inwards.  In particular the case bindings for
  array indexing.

* Also change the code in Simplify, to allow a case on array
  indexing (ie can_fail is true) to be discarded altogether if its
  results are unused.

Lots of new comments in PrimOp about can_fail and has_side_effects

Some refactoring to share the FloatBind data structure between
FloatIn and FloatOut
compiler/coreSyn/CorePrep.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/coreSyn/MkCore.lhs
compiler/prelude/PrimOp.lhs
compiler/simplCore/FloatIn.lhs
compiler/simplCore/FloatOut.lhs
compiler/simplCore/SimplEnv.lhs
compiler/simplCore/Simplify.lhs