[GHC] #14951: SpecContsr needs two runs when one should suffice

GHC ghc-devs at haskell.org
Wed Mar 21 16:19:55 UTC 2018


#14951: SpecContsr needs two runs when one should suffice
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:  SpecConstr
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14844            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sgraf):

 > What do you mean with worse?

 Well, assuming we would specialise `foo` for `foo s f (x,y)` without
 calling a specialised `l`, then we would just defer constructing the pair.
 So, you're right: not actually worse at all, but unnecessary code bloat,
 still.

 Come to think of it, have you tried to weave in
 [https://hackage.haskell.org/package/ghc-prim-0.5.1.1/docs/GHC-
 Types.html#t:SPEC GHC.Types.SPEC] into `foo`s signature instead? That
 essentially makes !SpecConstr forget to find matching `ArgOcc`s and
 blindly specialises for call sites and is probably what would help here,
 too. Probably at the expense of even worse code bloat when there are many
 different call patterns, but there is only one in your specific case.

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


More information about the ghc-tickets mailing list