[commit: ghc] master: Comments only (2acfaae)

git at git.haskell.org git at git.haskell.org
Fri Apr 15 11:45:57 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2acfaae9a99da6b7347cf21b38587f7fd251091c/ghc

>---------------------------------------------------------------

commit 2acfaae9a99da6b7347cf21b38587f7fd251091c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Apr 15 11:48:47 2016 +0100

    Comments only


>---------------------------------------------------------------

2acfaae9a99da6b7347cf21b38587f7fd251091c
 compiler/stranal/DmdAnal.hs  | 30 ++++++++++++++++--------------
 compiler/stranal/WorkWrap.hs | 13 +++++--------
 2 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs
index 4d3fd09..9a8999a 100644
--- a/compiler/stranal/DmdAnal.hs
+++ b/compiler/stranal/DmdAnal.hs
@@ -1335,28 +1335,30 @@ field of the AnalEnv.
 
 Note [Final Demand Analyser run]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 Some of the information that the demand analyser determines is not always
-preserved by the simplifier, for example, the simplifier will happily rewrite
+preserved by the simplifier.  For example, the simplifier will happily rewrite
   \y [Demand=1*U] let x = y in x + x
 to
   \y [Demand=1*U] y + y
 which is quite a lie.
 
-The once-used information is (currently) only used by the code generator, though. So we
- * do not bother keeping this information up-to-date in the simplifier, or
-   removing it after the demand analyser is done (keeping in mind not to
-   critically rely on this information in, say, the simplifier).
-   It should still be fine to use this as in heuristics, e.g. when deciding to
-   inline things, as the data will usually be correct.
- * Just before TidyCore, we add a pass of the demand analyse, without
-   subsequent worker/wrapper and simplifier, right before TidyCore.
-   This way, correct information  finds its way into the module interface
+The once-used information is (currently) only used by the code
+generator, though.  So:
+
+ * We zap the used-once info in the woker-wrapper;
+   see Note [Zapping Used Once info in WorkWrap] in WorkWrap. If it's
+   not reliable, it's better not to have it at all.
+
+ * Just before TidyCore, we add a pass of the demand analyser,
+      but WITHOUT subsequent worker/wrapper and simplifier,
+   right before TidyCore.  See SimplCore.getCoreToDo.
+
+   This way, correct information finds its way into the module interface
    (strictness signatures!) and the code generator (single-entry thunks!)
 
-Note that the single-call information (C1(..)) can be relied upon, as the
-simplifier tends to be very careful about not duplicating actual function
-calls.
+Note that, in contrast, the single-call information (C1(..)) /can/ be
+relied upon, as the simplifier tends to be very careful about not
+duplicating actual function calls.
 
 Also see #11731.
 -}
diff --git a/compiler/stranal/WorkWrap.hs b/compiler/stranal/WorkWrap.hs
index e557f44..80d966b 100644
--- a/compiler/stranal/WorkWrap.hs
+++ b/compiler/stranal/WorkWrap.hs
@@ -321,10 +321,7 @@ tryWW dflags fam_envs is_rec fn_id rhs
 {-
 Note [Zapping DmdEnv after Demand Analyzer]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In the worker-wrapper pass we zap the DmdEnv.
-
-Why?
+In the worker-wrapper pass we zap the DmdEnv.  Why?
  (a) it is never used again
  (b) it wastes space
  (c) it becomes incorrect as things are cloned, because
@@ -336,14 +333,14 @@ Why here?
  * We want them to be still there at the end of DmdAnal, so that
    -ddump-str-anal contains them.
  * We don’t want a second pass just for that.
- * WorkWrap looks at all bindings anyways.
+ * WorkWrap looks at all bindings anyway.
 
-We also need to do it in TidyCore to clean up after the final,
-worker/wrapper-less run of the demand analyser.
+We also need to do it in TidyCore.tidyLetBndr to clean up after the
+final, worker/wrapper-less run of the demand analyser (see
+Note [Final Demand Analyser run] in DmdAnal).
 
 Note [Zapping Used Once info in WorkWrap]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 In the worker-wrapper pass we zap the used once info in demands and in
 strictness signatures.
 



More information about the ghc-commits mailing list