patch applied (ghc): Refactor case-merging and
Simon Peyton Jones
simonpj at microsoft.com
Thu Nov 19 09:41:01 EST 2009
Thu Nov 19 04:37:04 PST 2009 simonpj at microsoft.com
* Refactor case-merging and identical-alternative optimisations
These two optimisations were originally done by SimplUtils.mkCase
*after* all the pieces have been simplified. Some while ago I
moved them *before*, so they were done by SimplUtils.prepareAlts.
It think the reason was that I couldn't rely on the dead-binder
information on OutIds, and that info is useful in these optimisations.
(a) Other changes (notably moving case-binder-swap to OccurAnal)
have meant that dead-binder information is accurate in
(b) When there is a cascade of case-merges, they happen in
one sweep if you do it after, but in many sweeps if you
do it before. Reason: doing it after means you are looking
at nice simplified Core.
M ./compiler/simplCore/SimplUtils.lhs -138 +232
M ./compiler/simplCore/Simplify.lhs -66 +30
View patch online:
More information about the Cvs-ghc