[GHC] #13589: Possible inconsistency in CSE's treatment of NOINLINE

GHC ghc-devs at haskell.org
Tue Apr 18 21:36:53 UTC 2017


#13589: Possible inconsistency in CSE's treatment of NOINLINE
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 That said, it is silly that we can't CSE
 {{{
 {-# INLINE [0] f #-}
 f x = blah

 {-# INLINE [0] g #-}
 g x = blah
 }}}
 How could we solve this?  Something like this:

 * Have `cs_map :: CoreMap (OutExpr, Activation)`

 * Add `blah :-> (f, ActiveAfter 0)` when extending the `cs_map` in
 `cse_bind`.

 * In `tryForCSE`, when called from `cse_bind`, pass the `Activation` of
 the binding (`g` in this example), and check that the `Activation` of the
 new Id is the same.

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


More information about the ghc-tickets mailing list