Skip to content
  • Ben Gamari's avatar
    cmm/CBE: Collapse blocks equivalent up to alpha renaming of local registers · 7920a7d9
    Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
    As noted in #14226, the common block elimination pass currently
    implements an extremely strict equivalence relation, demanding that two
    blocks are equivalent including the names of their local registers. This
    is quite restrictive and severely hampers the effectiveness of the pass.
    
    Here we allow the CBE pass to collapse blocks which are equivalent up to
    alpha renaming of locally-bound local registers. This is completely safe
    and catches many more duplicate blocks.
    
    Test Plan: Validate
    
    Reviewers: austin, simonmar, michalt
    
    Reviewed By: michalt
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #14226
    
    Differential Revision: https://phabricator.haskell.org/D3973
    7920a7d9