[GHC] #9509: No automatic specialization of inlinable imports in 7.8

GHC ghc-devs at haskell.org
Tue Dec 6 01:22:43 UTC 2016


#9509: No automatic specialization of inlinable imports in 7.8
-------------------------------------+-------------------------------------
        Reporter:  dolio             |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nfrisby):

 I now have a theory. Based on some of the notes I've found in the source
 code, I'm concluding (/recalling!) that "unfoldings should only be
 simplified gently" and "gently implies no eta-expansion". Notably,
 {{{SimplUtils.updModeForStableUnfoldings}}} sets {{{sm_eta_expand =
 False}}}, and the simplifier invokes that before entering a stable
 unfolding or a rule.

 However, in this case, we're seeing eta-expansion in the unfolding! I
 believe that is due to
 [https://github.com/ghc/ghc/blob/876b00ba25a615423f48b0cf9d443a9fd5dbd6f4/compiler/simplCore/SimplUtils.hs#L1294
 this use] of {{{gopt Opt_DoLambdaEtaExpansion dflags}}} in
 {{{SimplUtils.mkLam}}} --- it's checking the {{{DynFlag}}} instead of
 checking the {{{sm_eta_expand}}} flag within the {{{SimplEnv}}} (which is
 not passed to {{{mkLam}}}). Parts of the simplifier, notably
 {{{simplLam}}}, call {{{mkLam}}}.


 I've made "the fix" locally, and it indeed fixes this ticket's example
 case.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9509#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list