[commit: ghc] supercompiler: Treat letbounds and lambdabounds as cheap, for gods sake (b7c6fad)

Max Bolingbroke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/b7c6fad99c2031b15fc0f7d45a6a29d71fc342ba

>---------------------------------------------------------------

commit b7c6fad99c2031b15fc0f7d45a6a29d71fc342ba
Author: Max Bolingbroke <[email protected]>
Date:   Tue Jul 17 15:02:48 2012 +0100

    Treat letbounds and lambdabounds as cheap, for gods sake

>---------------------------------------------------------------

 compiler/supercompile/Supercompile/Drive/Split2.hs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Split2.hs b/compiler/supercompile/Supercompile/Drive/Split2.hs
index a84ba88..312c28f 100644
--- a/compiler/supercompile/Supercompile/Drive/Split2.hs
+++ b/compiler/supercompile/Supercompile/Drive/Split2.hs
@@ -475,7 +475,7 @@ push generalised (Heap h ids, k, focus) = (h', k', focus')
         -- in general anyway. 
         --
         -- NB: must explicitly avoid collapsing away any value nodes if they are marked as generalised
-        cheap_marked = (cheap_marked_k_head `S.union` S.fromDistinctAscList [HeapContext x' | (x', hb) <- M.toAscList h, Just (_, e) <- [heapBindingTerm hb], termIsCheap e]) S.\\ generalised
+        cheap_marked = (cheap_marked_k_head `S.union` S.fromDistinctAscList [HeapContext x' | (x', hb) <- M.toAscList h, maybe True (termIsCheap . snd) (heapBindingTerm hb)]) S.\\ generalised
         verts = shortcutEdges (`S.member` cheap_marked)
                               plusEntries (\ent1 _ ent2 -> ent1 `plusEntries` ent2)
                               (verts_h `M.union` (verts_k `unionDisjoint` verts_focus))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.