Skip to content
Snippets Groups Projects
Commit 391690c9 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Ian Lynagh
Browse files

Add case-floating to the float-out pass

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.
parent a735788f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment