[commit: ghc] wip/all-inlinable: Inline work start (5669ab3)

git at git.haskell.org git at git.haskell.org
Sun Jan 1 21:34:35 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/all-inlinable
Link       : http://ghc.haskell.org/trac/ghc/changeset/5669ab3d4bcbf777cd11dfd469d1d3ee432aa36a/ghc

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

commit 5669ab3d4bcbf777cd11dfd469d1d3ee432aa36a
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Sat Aug 6 22:17:09 2016 +0100

    Inline work start


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

5669ab3d4bcbf777cd11dfd469d1d3ee432aa36a
 compiler/deSugar/DsBinds.hs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs
index d8deff5..ab1cc75 100644
--- a/compiler/deSugar/DsBinds.hs
+++ b/compiler/deSugar/DsBinds.hs
@@ -327,7 +327,11 @@ makeCorePair :: DynFlags -> Id -> Bool -> Arity -> CoreExpr -> (Id, CoreExpr)
 makeCorePair dflags gbl_id is_default_method dict_arity rhs
   | is_default_method                 -- Default methods are *always* inlined
   = (gbl_id `setIdUnfolding` mkCompulsoryUnfolding rhs, rhs)
-
+  | pprTrace "isOverloadedTy" (ppr $ idType gbl_id)
+    (isEmptyInlineSpec inline_spec) &&
+      (isOverloadedTy (idType gbl_id))
+  = pprTrace "overloaded" (ppr "") (gbl_id `setIdUnfolding` inlinable_unf, rhs)
+    -- Expose unfolding of overloaded function if we know no better
   | otherwise
   = case inlinePragmaSpec inline_prag of
           EmptyInlineSpec -> (gbl_id, rhs)
@@ -337,6 +341,7 @@ makeCorePair dflags gbl_id is_default_method dict_arity rhs
 
   where
     inline_prag   = idInlinePragma gbl_id
+    inline_spec   = inlinePragmaSpec inline_prag
     inlinable_unf = mkInlinableUnfolding dflags rhs
     inline_pair
        | Just arity <- inlinePragmaSat inline_prag



More information about the ghc-commits mailing list