[commit: ghc] master: Add case-floating to the float-out pass (9cb20b4)
Simon Peyton Jones
simonpj at microsoft.com
Fri Jul 1 09:16:06 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/9cb20b488d4986c122b0461a54bc5c970f9d8502
>---------------------------------------------------------------
commit 9cb20b488d4986c122b0461a54bc5c970f9d8502
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Mon Jun 27 08:54:29 2011 +0100
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.
compiler/simplCore/FloatOut.lhs | 297 +++++++++++++++++++++----------------
compiler/simplCore/SetLevels.lhs | 302 ++++++++++++++++++++++----------------
2 files changed, 343 insertions(+), 256 deletions(-)
Diff suppressed because of size. To see it, use:
git show 9cb20b488d4986c122b0461a54bc5c970f9d8502
More information about the Cvs-ghc
mailing list