[GHC] #14226: Common Block Elimination pass doesn't eliminate common blocks

GHC ghc-devs at haskell.org
Tue Mar 27 13:53:36 UTC 2018


#14226: Common Block Elimination pass doesn't eliminate common blocks
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  michalt
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.2.1
  (CodeGen)                          |             Keywords:  newcomer,
      Resolution:                    |  CodeGen
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #9157, #14754     |  Differential Rev(s):  Phab:D3973,
       Wiki Page:                    |  Phab:D3999
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"d5c4d46a62ce6a0cfa6440344f707136eff18119/ghc"
 d5c4d46a/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="d5c4d46a62ce6a0cfa6440344f707136eff18119"
 CmmPipeline: add a second pass of CmmCommonBlockElim

 The sinking pass often gets rid of unnecessary registers
 registers/assignements exposing more opportunities for CBE, so this
 commit adds a second round of CBE after the sinking pass and should
 fix #12915 (and some examples in #14226).

 Nofib results:
 * Binary size:         0.9% reduction on average
 * Compile allocations: 0.7% increase on average
 * Runtime:             noisy, two separate runs of nofib showed a tiny
                        reduction on average, (~0.2-0.3%), but I think
                        this is mostly noise
 * Compile time:        very noisy, but generally within +/- 0.5% (one
                        run faster, one slower)

 One interesting part of this change is that running CBE invalidates
 results of proc-point analysis. But instead of re-doing the whole
 analysis, we can use the map that CBE creates for replacing/comparing
 block labels (maps a redundant label to a useful one) to update the
 results of proc-point analysis. This lowers the overhead compared to the
 previous experiment in #12915.

 Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>

 Test Plan: ./validate

 Reviewers: bgamari, simonmar

 Reviewed By: simonmar

 Subscribers: rwbarton, thomie, carter

 GHC Trac Issues: #12915, #14226

 Differential Revision: https://phabricator.haskell.org/D4417
 }}}

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


More information about the ghc-tickets mailing list