[GHC] #9157: cmm common block not eliminated

GHC ghc-devs at haskell.org
Mon Jun 2 07:48:22 UTC 2014


#9157: cmm common block not eliminated
-------------------------------------+------------------------------------
        Reporter:  wojteknar         |            Owner:  jstolarek
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  Other             |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by simonmar):

 Yes, I think Simon PJ's reason above is exactly why hashes don't include
 labels: so that the hashes remain stable under elimination of common
 blocks.  After eliminating some blocks, more opportunities for elimination
 emerge, so the algorithm keeps iterating until there are no more blocks to
 eliminate.

 Originally CBE was there to catch a common case of common blocks that
 occurred in the code we generated for case expressions.  But that pattern
 is handled directly by the code generator (we don't generate the common
 blocks anymore), and hence CBE is only enabled with -O.

 As with most optimisations, CBE interacts with other passes, so there may
 be more (or fewer) opportunities for CBE at different stages during the
 pipeline.  Whether it's worthwhile (a) having another CBE pass (maybe with
 -O2 only) or (b) moving the existing CBE pass later in the pipeline, is a
 matter for measurement.

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


More information about the ghc-tickets mailing list