summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Dataflow/Label.hs
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-01-22 15:24:08 +0100
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2020-01-31 12:21:10 +0300
commit2a87a565365d1724a83cd0d5c5fc3b696210c4f2 (patch)
tree648ae769b299abab942ebaca5a8ba54da798284e /compiler/GHC/Cmm/Dataflow/Label.hs
parentc846618ae0f8601515683a4c7677c20c3272a50f (diff)
downloadhaskell-2a87a565365d1724a83cd0d5c5fc3b696210c4f2.tar.gz
A few optimizations in STG and Cmm parts:
(Guided by the profiler output) - Add a few bang patterns, INLINABLE annotations, and a seqList in a few places in Cmm and STG parts. - Do not add external variables as dependencies in STG dependency analysis (GHC.Stg.DepAnal).
Diffstat (limited to 'compiler/GHC/Cmm/Dataflow/Label.hs')
-rw-r--r--compiler/GHC/Cmm/Dataflow/Label.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Cmm/Dataflow/Label.hs b/compiler/GHC/Cmm/Dataflow/Label.hs
index c571cedb48..b27ff341e5 100644
--- a/compiler/GHC/Cmm/Dataflow/Label.hs
+++ b/compiler/GHC/Cmm/Dataflow/Label.hs
@@ -107,11 +107,14 @@ instance IsMap LabelMap where
mapFoldlWithKey k z (LM m) =
mapFoldlWithKey (\a v -> k a (mkHooplLabel v)) z m
mapFoldMapWithKey f (LM m) = mapFoldMapWithKey (\k v -> f (mkHooplLabel k) v) m
+ {-# INLINEABLE mapFilter #-}
mapFilter f (LM m) = LM (mapFilter f m)
+ {-# INLINEABLE mapFilterWithKey #-}
mapFilterWithKey f (LM m) = LM (mapFilterWithKey (f . mkHooplLabel) m)
mapElems (LM m) = mapElems m
mapKeys (LM m) = map mkHooplLabel (mapKeys m)
+ {-# INLINEABLE mapToList #-}
mapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- mapToList m]
mapFromList assocs = LM (mapFromList [(lblToUnique k, v) | (k, v) <- assocs])
mapFromListWith f assocs = LM (mapFromListWith f [(lblToUnique k, v) | (k, v) <- assocs])