Skip to content
  • Joachim Breitner's avatar
    CmmCommonBlockElim: Improve hash function · 73f836f5
    Joachim Breitner authored
    Previously, the hash function used to cut down the number of block
    comparisons did not take local registers into account, causing far too
    many similar, but different bocks to be considered candidates for the
    (expensive!) comparision.
    
    Adding register to the hash takes CmmCommonBlockElim's share of the
    runtime of the example in #10397 from 17% to 2.5%, and eliminates all
    unwanted hash collisions.
    
    This patch also replaces the fancy trie by a plain Data.Map. It turned
    out to be not performance critical, so this simplifies the code.
    
    Differential Revision: https://phabricator.haskell.org/D896
    73f836f5