[GHC] #9136: Constant folding in Core could be better

GHC ghc-devs at haskell.org
Tue May 3 04:52:32 UTC 2016


#9136: Constant folding in Core could be better
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.2
      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:                    |
-------------------------------------+-------------------------------------
Changes (by akio):

 * cc: akio (added)


Comment:

 I just came across the core output `((1 +# ((x -# 1) +# 1)) +# 1) +# 1`
 from some array indexing code, and thought that this kind of constant
 folding would be nice. However I don't have a standalone benchmark (yet)
 and consequently I don't know how much speed improvement could be achieved
 by the optimization.

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


More information about the ghc-tickets mailing list