diff options
author | Michal Terepeta <michal.terepeta@gmail.com> | 2016-11-02 15:05:19 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-02 15:42:01 -0400 |
commit | dc4d59621dff31908dc7646082a2c5a362deb10f (patch) | |
tree | 063ce7e359630cb9d7a9849fe948f283de86abc7 /compiler/cmm/CmmLive.hs | |
parent | 6fecb7e784daabe3f62ef8090e7019d7ad384080 (diff) | |
download | haskell-dc4d59621dff31908dc7646082a2c5a362deb10f.tar.gz |
Hoopl/Dataflow: make the module more self-contained
This makes the GHC's Dataflow module more self-contained by also
forking the `DataflowLattice` (instead of only the analysis
algorithm). Effects/benefits:
- We no longer need to use the deprecated Hoopl functions (and can
remove `-fno-warn-warnings-deprecations` from two modules).
- We can remove the unnecessary `Label` parameter of `JoinFun` (already
ignored in all our implementations).
- We no longer mix Hoopl's `Dataflow` module and GHC's one.
- We can replace some calls to lazy folds in Hoopl with the strict ones
(see `joinOutFacts` and `mkFactBase`).
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: validate
Reviewers: austin, simonmar, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2660
Diffstat (limited to 'compiler/cmm/CmmLive.hs')
-rw-r--r-- | compiler/cmm/CmmLive.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/cmm/CmmLive.hs b/compiler/cmm/CmmLive.hs index 97bf361bcd..5346f4986c 100644 --- a/compiler/cmm/CmmLive.hs +++ b/compiler/cmm/CmmLive.hs @@ -3,9 +3,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} --- See Note [Deprecations in Hoopl] in Hoopl module -{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} - module CmmLive ( CmmLocalLive , cmmLocalLiveness @@ -36,10 +33,11 @@ type CmmLocalLive = CmmLive LocalReg liveLattice :: Ord r => DataflowLattice (CmmLive r) {-# SPECIALIZE liveLattice :: DataflowLattice (CmmLive LocalReg) #-} {-# SPECIALIZE liveLattice :: DataflowLattice (CmmLive GlobalReg) #-} -liveLattice = DataflowLattice "live LocalReg's" emptyRegSet add - where add _ (OldFact old) (NewFact new) = - (changeIf $ sizeRegSet join > sizeRegSet old, join) - where !join = plusRegSet old new +liveLattice = DataflowLattice emptyRegSet add + where + add (OldFact old) (NewFact new) = + let !join = plusRegSet old new + in changedIf (sizeRegSet join > sizeRegSet old) join -- | A mapping from block labels to the variables live on entry |