diff options
| author | Joachim Breitner <mail@joachim-breitner.de> | 2016-07-07 11:23:48 +0200 |
|---|---|---|
| committer | Joachim Breitner <mail@joachim-breitner.de> | 2016-08-25 18:17:16 +0200 |
| commit | 8d92b88df7c1c04606c8a9e12c1d4bee65c990e4 (patch) | |
| tree | c00eb34c88b48ec5cb6f1410eb7cee750a247911 /compiler/utils/UniqFM.hs | |
| parent | 7a86f58436434e7228efc7bd88a18230de104825 (diff) | |
| download | haskell-8d92b88df7c1c04606c8a9e12c1d4bee65c990e4.tar.gz | |
DmdAnal: Add a final, safe iteration
this fixes #12368.
It also refactors dmdFix a bit, removes some redundancies (such as
passing around an strictness signature right next to an id, when that id
is guaranteed to have been annotated with that strictness signature).
Note that when fixed-point iteration does not terminate, we
conservatively delete their strictness signatures (set them to nopSig).
But this loses the information on how its strict free variables are
used!
Lazily used variables already escape via lazy_fvs. We ensure that in the
case of an aborted fixed-point iteration, also the strict variables are
put there (with a conservative demand of topDmd).
Differential Revision: https://phabricator.haskell.org/D2392
Diffstat (limited to 'compiler/utils/UniqFM.hs')
| -rw-r--r-- | compiler/utils/UniqFM.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/utils/UniqFM.hs b/compiler/utils/UniqFM.hs index 244969cc91..be5da8373b 100644 --- a/compiler/utils/UniqFM.hs +++ b/compiler/utils/UniqFM.hs @@ -49,6 +49,7 @@ module UniqFM ( plusUFM, plusUFM_C, plusUFM_CD, + plusUFMList, minusUFM, intersectUFM, intersectUFM_C, @@ -71,6 +72,8 @@ module UniqFM ( import Unique ( Uniquable(..), Unique, getKey ) import Outputable +import Data.List (foldl') + import qualified Data.IntMap as M import qualified Data.IntSet as S import Data.Typeable @@ -214,6 +217,9 @@ plusUFM_CD f (UFM xm) dx (UFM ym) dy (M.map (\y -> dx `f` y)) xm ym +plusUFMList :: [UniqFM elt] -> UniqFM elt +plusUFMList = foldl' plusUFM emptyUFM + minusUFM :: UniqFM elt1 -> UniqFM elt2 -> UniqFM elt1 minusUFM (UFM x) (UFM y) = UFM (M.difference x y) |
