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

GHC ghc-devs at haskell.org
Sat Oct 28 21:50:40 UTC 2017


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

Comment (by nomeata):

 I see these two blocks not being commoned up:
 {{{
   c4bx: // global
       I64[_s3Yp::P64] = stg_MUT_ARR_PTRS_FROZEN0_info;   // CmmStore
       _s3YJ::P64 = _s3Yp::P64;   // CmmAssign
       _s3YJ::P64 = _s3YJ::P64;   // CmmAssign
       I64[Hp - 48] = GHC.Types.I#_con_info;   // CmmStore
       I64[Hp - 40] = _s3Yj::I64;   // CmmStore
       _c4bX::P64 = Hp - 47;   // CmmAssign
       I64[Hp - 32] = GHC.Arr.Array_con_info;   // CmmStore
       P64[Hp - 24] = Database.idatabase1_closure+1;   // CmmStore
       P64[Hp - 16] = _c4bX::P64;   // CmmStore
       P64[Hp - 8] = _s3YJ::P64;   // CmmStore
       I64[Hp] = _s3Yq::I64;   // CmmStore
       _c4bY::P64 = Hp - 31;   // CmmAssign
       _s3YW::P64 = _c4bY::P64;   // CmmAssign
       goto c4b9;   // CmmBranch
 }}}
 and
 {{{
   c4bD: // global
       I64[_s3Yp::P64] = stg_MUT_ARR_PTRS_FROZEN0_info;   // CmmStore
       _s3Yy::P64 = _s3Yp::P64;   // CmmAssign
       _s3Yy::P64 = _s3Yy::P64;   // CmmAssign
       I64[Hp - 48] = GHC.Types.I#_con_info;   // CmmStore
       I64[Hp - 40] = _s3Yj::I64;   // CmmStore
       _c4bZ::P64 = Hp - 47;   // CmmAssign
       I64[Hp - 32] = GHC.Arr.Array_con_info;   // CmmStore
       P64[Hp - 24] = Database.idatabase1_closure+1;   // CmmStore
       P64[Hp - 16] = _c4bZ::P64;   // CmmStore
       P64[Hp - 8] = _s3Yy::P64;   // CmmStore
       I64[Hp] = _s3Yq::I64;   // CmmStore
       _c4c0::P64 = Hp - 31;   // CmmAssign
       _s3YW::P64 = _c4c0::P64;   // CmmAssign
       goto c4b9;   // CmmBranch
 }}}

 Should they? Does maybe the `_s3YJ::P64 = _s3YJ::P64;` throw CBE off?

 (This is from nofib’s `fem` with commit d871321ce20e – not sure how useful
 this commit ID is, as it is from a rebasing branch and so far it only
 lives on Phabricator.)

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


More information about the ghc-tickets mailing list