diff options
author | Ben Gamari <ben@smart-cactus.org> | 2016-05-10 11:57:02 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-05-12 15:16:07 +0200 |
commit | ba46dd060f959e3c96a74c1546946c3f8bf84dd0 (patch) | |
tree | faa22032f485d0222bb102645971dd82e76236c2 /compiler/nativeGen | |
parent | e996e85f003e783fc8f9af0da653cdd0058d9646 (diff) | |
download | haskell-wip/foldl.tar.gz |
Use strict foldlswip/foldl
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/nativeGen/AsmCodeGen.hs index 6bb7f8a875..ed1d1ffdc8 100644 --- a/compiler/nativeGen/AsmCodeGen.hs +++ b/compiler/nativeGen/AsmCodeGen.hs @@ -312,7 +312,7 @@ finishNativeGen dflags modLoc bufh@(BufHandle _ _ h) us ngs -- build the global register conflict graph let graphGlobal - = foldl Color.union Color.initGraph + = foldl' Color.union Color.initGraph $ [ Color.raGraph stat | stat@Color.RegAllocStatsStart{} <- stats] @@ -863,8 +863,8 @@ build_mapping ncgImpl (CmmProc info lbl live (ListGraph (head:blocks))) -- find all the blocks that just consist of a jump that can be -- shorted. -- Don't completely eliminate loops here -- that can leave a dangling jump! - (_, shortcut_blocks, others) = foldl split (emptyBlockSet, [], []) blocks - split (s, shortcut_blocks, others) b@(BasicBlock id [insn]) + (_, shortcut_blocks, others) = foldl' split (emptyBlockSet, [], []) blocks + split (!s, !shortcut_blocks, !others) b@(BasicBlock id [insn]) | Just jd <- canShortcut ncgImpl insn, Just dest <- getJumpDestBlockId ncgImpl jd, not (has_info id), @@ -880,8 +880,7 @@ build_mapping ncgImpl (CmmProc info lbl live (ListGraph (head:blocks))) has_info l = mapMember l info -- build a mapping from BlockId to JumpDest for shorting branches - mapping = foldl add emptyUFM shortcut_blocks - add ufm (id,dest) = addToUFM ufm id dest + mapping = listToUFM shortcut_blocks apply_mapping :: NcgImpl statics instr jumpDest -> UniqFM jumpDest |