Commit 7920a7d9 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

cmm/CBE: Collapse blocks equivalent up to alpha renaming of local registers

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
parent 3198956d
This diff is collapsed.
......@@ -24,6 +24,7 @@ module Hoopl.Block
, foldBlockNodesB
, foldBlockNodesB3
, foldBlockNodesF
, foldBlockNodesF3
, isEmptyBlock
, lastNode
, mapBlock
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment