Skip to content
  • Simon Peyton Jones's avatar
    Add case-floating to the float-out pass · 9cb20b48
    Simon Peyton Jones authored
    There are two things in this patch. First, a new feature.
    Given     (case x of I# y -> ...)
    where 'x' is known to be evaluated, the float-out pass
    will float the case outwards towards x's binding.  Of
    course this doesn't happen if 'x' is evaluated because
    of an enclosing case (becuase then the inner case would
    be eliminated) but it *does* happen when x is bound by
    a constructor with a strict field.  This happens in DPH.
    Trac #4081.
    
    The second change is a significant refactoring of the
    way the let-floater works.  Now SetLevels makes a decision
    about whether the let (or case) will move, and records
    that decision in the FloatSpec flag.  This change makes
    the whole caboodle much easier to think about.
    9cb20b48