[GHC] #9529: Clean up cseProgram

GHC ghc-devs at haskell.org
Sat Aug 30 20:59:14 UTC 2014


#9529: Clean up cseProgram
-------------------------------------+-------------------------------------
       Reporter:  dfeuer             |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:  7.8.4
      Component:  Compiler           |                 Version:  7.9
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Easy (less than 1  |         Type of failure:
  hour)                              |  None/Unknown
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 I think this should be a no-brainer:

 Replace

 {{{#!hs
 cseProgram :: CoreProgram -> CoreProgram
 cseProgram binds = cseBinds emptyCSEnv binds

 cseBinds :: CSEnv -> [CoreBind] -> [CoreBind]
 cseBinds _   []     = []
 cseBinds env (b:bs) = (b':bs')
                     where
                       (env1, b') = cseBind  env  b
                       bs'        = cseBinds env1 bs
 }}}

 with

 {{{#!hs
 cseProgram :: CoreProgram -> CoreProgram
 cseProgram = snd . mapAccumL cseBind emptyCSEnv
 }}}

 I'll attach a patch.

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


More information about the ghc-tickets mailing list