CmmCommonBlockElim: Improve hash function
authorJoachim Breitner <mail@joachim-breitner.de>
Mon, 18 May 2015 08:39:54 +0000 (10:39 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 18 May 2015 11:11:33 +0000 (13:11 +0200)
commit73f836f5d57a3106029b573c42f83d2039d21d89
tree851d21fa16ef196fe6d439265f8d25205d596140
parent8e4dc8fb63b8d3bfee485c1c830776f3ed704f4d
CmmCommonBlockElim: Improve hash function

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
compiler/cmm/CmmCommonBlockElim.hs