summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmCommonBlockElim.hs
diff options
context:
space:
mode:
authorMichal Terepeta <michal.terepeta@gmail.com>2018-04-13 11:31:38 -0400
committerBen Gamari <ben@smart-cactus.org>2018-04-13 11:33:09 -0400
commit78ff6e541d33d2d2caf52d2cb4578cd7b745d282 (patch)
tree257791dd2a59e5f6321bc0277cae5b56ff87a937 /compiler/cmm/CmmCommonBlockElim.hs
parentf02309fe66606ffbd2d52d9347438e11890f7cfa (diff)
downloadhaskell-78ff6e541d33d2d2caf52d2cb4578cd7b745d282.tar.gz
Revert "CmmPipeline: add a second pass of CmmCommonBlockElim"
This reverts commit d5c4d46a62ce6a0cfa6440344f707136eff18119. Please see #14989 for details. Test Plan: ./validate Reviewers: bgamari, simonmar Subscribers: thomie, carter GHC Trac Issues: #14989 Differential Revision: https://phabricator.haskell.org/D4577
Diffstat (limited to 'compiler/cmm/CmmCommonBlockElim.hs')
-rw-r--r--compiler/cmm/CmmCommonBlockElim.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/cmm/CmmCommonBlockElim.hs b/compiler/cmm/CmmCommonBlockElim.hs
index ad10511c1d..c91d553c47 100644
--- a/compiler/cmm/CmmCommonBlockElim.hs
+++ b/compiler/cmm/CmmCommonBlockElim.hs
@@ -59,10 +59,9 @@ import Data.List (foldl')
-- hashes, and at most once otherwise. Previously, we were slower, and people
-- rightfully complained: #10397
-type Subst = LabelMap BlockId
-
-elimCommonBlocks :: CmmGraph -> (CmmGraph, Subst)
-elimCommonBlocks g = (replaceLabels env $ copyTicks env g, env)
+-- TODO: Use optimization fuel
+elimCommonBlocks :: CmmGraph -> CmmGraph
+elimCommonBlocks g = replaceLabels env $ copyTicks env g
where
env = iterate mapEmpty blocks_with_key
-- The order of blocks doesn't matter here, but revPostorder also drops any
@@ -74,6 +73,7 @@ elimCommonBlocks g = (replaceLabels env $ copyTicks env g, env)
-- (so avoid comparing them again)
type DistinctBlocks = [CmmBlock]
type Key = [Label]
+type Subst = LabelMap BlockId
-- The outer list groups by hash. We retain this grouping throughout.
iterate :: Subst -> [[(Key, DistinctBlocks)]] -> Subst