diff options
-rw-r--r-- | compiler/GHC/CmmToAsm/CFG.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs index 5db10ce93f..63b488d482 100644 --- a/compiler/GHC/CmmToAsm/CFG.hs +++ b/compiler/GHC/CmmToAsm/CFG.hs @@ -307,7 +307,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 |