[commit: ghc] wip/T13227: Improve the Occurrence Analyzer’s handling of one-shot functions (a9dc47a)
git at git.haskell.org
git at git.haskell.org
Sun Feb 5 15:53:18 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T13227
Link : http://ghc.haskell.org/trac/ghc/changeset/a9dc47a1b9950afc4690f950dbcbf0f135a20b45/ghc
>---------------------------------------------------------------
commit a9dc47a1b9950afc4690f950dbcbf0f135a20b45
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sun Feb 5 10:52:12 2017 -0500
Improve the Occurrence Analyzer’s handling of one-shot functions
as suggested by Simon. This commit is sent to perf.haskell.org, and will
be commented before it goes towards master.
>---------------------------------------------------------------
a9dc47a1b9950afc4690f950dbcbf0f135a20b45
compiler/simplCore/OccurAnal.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs
index b02ddc9..b328146 100644
--- a/compiler/simplCore/OccurAnal.hs
+++ b/compiler/simplCore/OccurAnal.hs
@@ -1867,7 +1867,7 @@ occAnalApp env (Var fun, args, ticks)
-- This is the *whole point* of the isRhsEnv predicate
-- See Note [Arguments of let-bound constructors]
- n_val_args = valArgCount args
+ n_val_args = valArgCount args + length (occ_one_shots env)
n_args = length args
fun_uds = mkOneOcc env fun (n_val_args > 0) n_args
is_exp = isExpandableApp fun n_val_args
@@ -1876,7 +1876,7 @@ occAnalApp env (Var fun, args, ticks)
-- Simplify.prepareRhs
one_shots = argsOneShots (idStrictness fun) n_val_args
- -- See Note [Use one-shot info]
+ -- See Note [Use one-shot information]
occAnalApp env (fun, args, ticks)
= (markAllNonTailCalled (fun_uds +++ args_uds),
More information about the ghc-commits
mailing list