[commit: ghc] supercompiler: Ensure wrappers are SUPERINLINABLE (61f74db)

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/61f74db90cba9d4e5b9d9a9207f1cba6311dc0ff

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

commit 61f74db90cba9d4e5b9d9a9207f1cba6311dc0ff
Author: Max Bolingbroke <[email protected]>
Date:   Fri Nov 16 14:11:22 2012 +0000

    Ensure wrappers are SUPERINLINABLE

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

 compiler/supercompile/Supercompile.hs              |    1 +
 .../Supercompile/Evaluator/Evaluate.hs             |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/compiler/supercompile/Supercompile.hs b/compiler/supercompile/Supercompile.hs
index 4dad93c..ae08183 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -191,6 +191,7 @@ termUnfoldings {-mod_finder-} e = go (S.termFreeVars e) emptyVarSet [] []
     -- We still do check shouldExposeUnfolding here because we can avoid parsing+tagging those unfoldings
     -- which can literall never be used.
     varUnfolding x
+      -- NB: probably want to ensure these are all considered superinlinable by shouldExposeUnfolding for the evaluator
       | Just pop <- isPrimOpId_maybe x     = Right $ primOpUnfolding pop
       | Just dc <- isDataConWorkId_maybe x = dataUnfolding dc
       | otherwise                          = case S.shouldExposeUnfolding x of
diff --git a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
index fe196cf..d3556bf 100644
--- a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
+++ b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
@@ -562,6 +562,9 @@ shouldExposeUnfolding x = case inl_inline inl_prag of
     _ | Just mod <- nameModule_maybe (idName x)
       , moduleName mod `elem` map mkModuleName ["Data.Complex", "GHC.List"]
       -> Right True
+    -- These get wrappers generated for them: be very eager to inline the wrappers
+      | isPrimOpId x || isDataConWorkId x
+      -> Right True
     -- NB: we don't check the activation on INLINE things because so many activations
     -- are used to ensure that e.g. RULE-based fusion works properly, and NOINLINE will
     -- generally impede supercompiler-directed fusion.
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.