[GHC] #12354: Word foldl' isn't optimized as well as Int foldl'

GHC ghc-devs at haskell.org
Fri Jul 1 11:10:37 UTC 2016


#12354: Word foldl' isn't optimized as well as Int foldl'
-------------------------------------+-------------------------------------
        Reporter:  kjslag            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      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 bgamari):

 > Well you might hope that you could write `eftInt`, `eftIntFB` once, at
 type `a` and SPECIALISE them. That would save copying them manually.

 Indeed, unfortunately this would require that `eftInt` be runtime-
 representationally polymorphic since `Word :: RuntimeRep WordRep` and `Int
 :: RuntimeRep IntRep`. This is a rather unfortunate limitation since we
 would like to ensure that the polymorphism is resolved at compile-time via
 inlining.

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


More information about the ghc-tickets mailing list