[GHC] #14372: CMM contains a bunch of tail-merging opportunities

GHC ghc-devs at haskell.org
Sun Oct 22 09:28:05 UTC 2017


#14372: CMM contains a bunch of tail-merging opportunities
-------------------------------------+-------------------------------------
        Reporter:  heisenbug         |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 Replying to [comment:8 heisenbug]:
 > Replying to [comment:7 heisenbug]:
 > > `-fcmm-elim-common-blocks` helps a bit, but many equal ones are not
 caught:
 > >
 >
 > Turns out c-b-e is a local optimisation, i.e. per procedure. We need a
 global one to crack this.

 Okay I now have the beginnings of a global CMM C-B-E here:
 https://github.com/ggreif/ghc/tree/wip/global-cmm-cbe

 Feedback welcome!

 Some comments (for self)
 * better use `ST(Refs)` to not mess with GHC's `-j` mode (multi-module
 compilation)
 * `CmmProc`s should be transformed. Not yet done. Graph label to branch
 transformation is bogus, but keeping it as an example for now.

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


More information about the ghc-tickets mailing list