summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/CmmToAsm')
-rw-r--r--compiler/GHC/CmmToAsm/CFG.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs
index 21e35afafe..43c0764bad 100644
--- a/compiler/GHC/CmmToAsm/CFG.hs
+++ b/compiler/GHC/CmmToAsm/CFG.hs
@@ -305,7 +305,9 @@ shortcutWeightMap cuts cfg =
applyMapping m (from, Just to) =
let updatedMap :: CFG
updatedMap
- = fmap (shortcutEdge (from,to)) $
+ -- Careful here to use a strict mapping function, the derived
+ -- Functor instance is lazy and leads to a large thunk build-up. #19471/!6523
+ = mapMap (shortcutEdge (from,to)) $
(mapDelete from m :: CFG )
--Sometimes we can shortcut multiple blocks like so:
-- A -> B -> C -> D -> E => A -> E