diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2013-11-22 17:13:05 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2013-12-02 17:33:59 +0000 |
commit | 20cc59419b5fae60eea9c81f56020ef15256dc84 (patch) | |
tree | 70a54aa0f99ceb69374ed7ec036f4381b649e5c3 /compiler/simplCore/SetLevels.lhs | |
parent | 51deeb0db3abac9f4369d3f8a3744e1313ecebf4 (diff) | |
download | haskell-better-ho-cardinality.tar.gz |
Improve the handling of used-once stuffbetter-ho-cardinality
Joachim and I are committing this onto a branch so that we can share it,
but we expect to do a bit more work before merging it onto head.
Nofib staus:
- Most programs, no change
- A few improve
- A couple get worse (cacheprof, tak, rfib)
Investigating the "get worse" set is what's holding up putting this
on head.
The major issue is this. Consider
map (f g) ys
where f's demand signature looks like
f :: <L,C1(C1(U))> -> <L,U> -> .
So 'f' is not saturated. What demand do we place on g?
Answer
C(C1(U))
That is, the inner C1 should stay, even though f is not saturated.
I found that this made a significant difference in the demand signatures
inferred in GHC.IO, which uses lots of higher-order exception handlers.
I also had to add used-once demand signatures for some of the
'catch' primops, so that we know their handlers are only called once.
Diffstat (limited to 'compiler/simplCore/SetLevels.lhs')
-rw-r--r-- | compiler/simplCore/SetLevels.lhs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/simplCore/SetLevels.lhs b/compiler/simplCore/SetLevels.lhs index 2fca56cf17..7bcc53f6de 100644 --- a/compiler/simplCore/SetLevels.lhs +++ b/compiler/simplCore/SetLevels.lhs @@ -815,7 +815,9 @@ lvlLamBndrs lvl bndrs new_lvl | any is_major bndrs = incMajorLvl lvl | otherwise = incMinorLvl lvl - is_major bndr = isId bndr && not (isOneShotLambda bndr) + is_major bndr = isId bndr && not (isProbablyOneShotLambda bndr) + -- The "probably" part says "don't float things out of a + -- probable one-shot lambda" \end{code} \begin{code} |