diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2020-02-17 09:56:33 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-20 21:20:45 -0500 |
commit | 65b7256a88ae2bd878da5d026e4183cba6f6eedf (patch) | |
tree | feae01641c4fcbaa438dda9298d7d9ca2430eb85 /compiler/nativeGen | |
parent | c8439fc789ff00cfdd453d2425d2146df69e0729 (diff) | |
download | haskell-65b7256a88ae2bd878da5d026e4183cba6f6eedf.tar.gz |
Use concatMap(M) instead of `concat . map` and the monadic variant
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r-- | compiler/nativeGen/RegAlloc/Graph/ArchBase.hs | 4 | ||||
-rw-r--r-- | compiler/nativeGen/RegAlloc/Liveness.hs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs b/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs index 634e61cb13..c38d998779 100644 --- a/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs +++ b/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs @@ -21,11 +21,13 @@ module RegAlloc.Graph.ArchBase ( bound, squeese ) where + import GhcPrelude import UniqSet import UniqFM import Unique +import MonadUtils (concatMapM) -- Some basic register classes. @@ -152,7 +154,7 @@ squeese regsOfClass regAlias classN countCs -- | powerset (for lists) powersetL :: [a] -> [[a]] -powersetL = map concat . mapM (\x -> [[],[x]]) +powersetL = concatMapM (\x -> [[],[x]]) -- | powersetLS (list of sets) diff --git a/compiler/nativeGen/RegAlloc/Liveness.hs b/compiler/nativeGen/RegAlloc/Liveness.hs index cf17d149e9..e1bbb467d0 100644 --- a/compiler/nativeGen/RegAlloc/Liveness.hs +++ b/compiler/nativeGen/RegAlloc/Liveness.hs @@ -719,7 +719,7 @@ sccBlocks blocks entries mcfg = map (fmap node_payload) sccs sccs = stronglyConnCompG g2 getOutEdges :: Instruction instr => [instr] -> [BlockId] - getOutEdges instrs = concat $ map jumpDestsOfInstr instrs + getOutEdges instrs = concatMap jumpDestsOfInstr instrs -- This is truly ugly, but I don't see a good alternative. -- Digraph just has the wrong API. We want to identify nodes |