Commit ecb316c4 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

nativeGen: A few strictness fixes

Test Plan: Validate

Reviewers: austin, simonmar

Subscribers: rwbarton, thomie

Differential Revision:
parent 04bb8736
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
module CmmContFlowOpt
( cmmCfgOpts
......@@ -194,7 +195,7 @@ blockConcat splitting_procs g@CmmGraph { g_entry = entry_id }
maybe_concat :: CmmBlock
-> (LabelMap CmmBlock, LabelMap BlockId, LabelMap Int)
-> (LabelMap CmmBlock, LabelMap BlockId, LabelMap Int)
maybe_concat block (blocks, shortcut_map, backEdges)
maybe_concat block (!blocks, !shortcut_map, !backEdges)
-- If:
-- (1) current block ends with unconditional branch to b' and
-- (2) it has exactly one predecessor (namely, current block)
......@@ -416,4 +417,4 @@ removeUnreachableBlocksProc proc@(CmmProc info lbl live g)
used_blocks = postorderDfs g
used_lbls :: LabelSet
used_lbls = foldr (setInsert . entryLabel) setEmpty used_blocks
used_lbls = setFromList $ map entryLabel used_blocks
......@@ -19,7 +19,7 @@ import CmmUtils
import CmmInfo
import CmmLive
import CmmSwitch
import Data.List (sortBy)
import Data.List (sortBy, foldl')
import Maybes
import Control.Monad
import Outputable
......@@ -279,8 +279,8 @@ splitAtProcPoints dflags entry_label callPPs procPoints procMap
where block_lbl = blockLbl pp
procLabels :: LabelMap (CLabel, Maybe CLabel)
procLabels = foldl add_label mapEmpty
(filter (flip mapMember (toBlockMap g)) (setElems procPoints))
procLabels = foldl' add_label mapEmpty
(filter (flip mapMember (toBlockMap g)) (setElems procPoints))
-- In each new graph, add blocks jumping off to the new procedures,
-- and replace branches to procpoints with branches to the jump-off blocks
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment