[commit: ghc] supercompiler: Small tweaks, still doesn't work (77f89c7)

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/77f89c7a7d82541efd5da9754066a38269dcad8b

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

commit 77f89c7a7d82541efd5da9754066a38269dcad8b
Author: Max Bolingbroke <[email protected]>
Date:   Thu Oct 20 10:04:04 2011 +0100

    Small tweaks, still doesn't work

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

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

diff --git a/compiler/supercompile/Supercompile.hs b/compiler/supercompile/Supercompile.hs
index 60340a9..02c371c 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -218,7 +218,7 @@ termToCoreExpr = term
 -- NB: assumes no-shadowing at the top level. I don't want to have to rename stuff to
 -- commute CoreBinds...
 partitionBinds :: (Id -> Bool) -> [CoreBind] -> ([CoreBind], [CoreBind], S.FreeVars)
-partitionBinds should_sc initial_binds = go initial_inside [(b, unionVarSets (map exprFreeVars (rhssOfBind b))) | b <- initial_undecided]
+partitionBinds should_sc initial_binds = go initial_inside [(b, unionVarSets (map S.idFreeVars (bindersOf b) ++ map exprFreeVars (rhssOfBind b))) | b <- initial_undecided]
   where
     (initial_inside, initial_undecided) = partition (any should_sc . bindersOf) initial_binds
     
diff --git a/compiler/supercompile/Supercompile/Drive/Match.hs b/compiler/supercompile/Supercompile/Drive/Match.hs
index 2cb4ec9..9429344 100644
--- a/compiler/supercompile/Supercompile/Drive/Match.hs
+++ b/compiler/supercompile/Supercompile/Drive/Match.hs
@@ -406,7 +406,7 @@ matchPureHeap rn2 init_free_eqs h_l h_r
       where go extra_free_eqs used_l' used_r' = do
                 -- Don't forget to match types/unfoldings of binders as well:
                 bndr_free_eqs <- matchBndrExtras rn2 x_l x_r
-                matchLoop ((x_l, x_r) : bndr_free_eqs ++ known) (extra_free_eqs ++ free_eqs) used_l' used_r'
+                matchLoop ((x_l, x_r) : known) (bndr_free_eqs ++ extra_free_eqs ++ free_eqs) used_l' used_r'
 
 app3 :: [a] -> [a] -> [a] -> [a]
 app3 x y z = x ++ y ++ z
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.