[GHC] #8763: forM_ [1..N] does not get fused (allocates 50% more)

GHC ghc-devs at haskell.org
Wed Sep 5 15:19:02 UTC 2018


#8763: forM_ [1..N] does not get fused (allocates 50% more)
-------------------------------------+-------------------------------------
        Reporter:  nh2               |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  7.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #7206             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sgraf):

 Right, actually I was aware of INLINE unfoldings being captured as the
 unoptimized variant, but have never seen it to actively prevent (or rather
 postpone) inlining of another part of the code. Quite a neat trick!

 I've identified some other functions that should probably rewritten the
 same way (`traverse_`, `foldrM`, etc.). No regressions, no improvements
 according to NoFib. Phab:D5131 passes `./validate.sh`.

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


More information about the ghc-tickets mailing list