... | @@ -20,17 +20,17 @@ See also sub-pages: |
... | @@ -20,17 +20,17 @@ See also sub-pages: |
|
|
|
|
|
### Related tickets
|
|
### Related tickets
|
|
|
|
|
|
- [\#1600](https://gitlab.haskell.org/ghc/ghc/issues/1600) Main tickets where I mention progress.
|
|
- #1600 Main tickets where I mention progress.
|
|
|
|
|
|
|
|
|
|
Tickets with stuff that would make nested CPR better:
|
|
Tickets with stuff that would make nested CPR better:
|
|
|
|
|
|
- [\#8598](https://gitlab.haskell.org/ghc/ghc/issues/8598) CPR after IO (partly done)
|
|
- #8598 CPR after IO (partly done)
|
|
|
|
|
|
|
|
|
|
Tickets with example of code that would benefit from nested CPR:
|
|
Tickets with example of code that would benefit from nested CPR:
|
|
|
|
|
|
- [\#1600](https://gitlab.haskell.org/ghc/ghc/issues/1600), [\#2289](https://gitlab.haskell.org/ghc/ghc/issues/2289), [\#2387](https://gitlab.haskell.org/ghc/ghc/issues/2387) (see [below](nested-cpr#motivating-examples) for an analysis)
|
|
- #1600, #2289, #2387 (see [below](nested-cpr#motivating-examples) for an analysis)
|
|
- (Maybe) [this thread on ghc-devs](https://mail.haskell.org/pipermail/ghc-devs/2016-March/011623.html)
|
|
- (Maybe) [this thread on ghc-devs](https://mail.haskell.org/pipermail/ghc-devs/2016-March/011623.html)
|
|
|
|
|
|
### Tickets
|
|
### Tickets
|
... | @@ -103,9 +103,9 @@ No results |
... | @@ -103,9 +103,9 @@ No results |
|
Motivation is always good. Here I try to look at examples where people were expecting or hoping for nested CPR, and see how we are fairing:
|
|
Motivation is always good. Here I try to look at examples where people were expecting or hoping for nested CPR, and see how we are fairing:
|
|
|
|
|
|
|
|
|
|
- `facIO` in [\#1600](https://gitlab.haskell.org/ghc/ghc/issues/1600): Not eligible for nested CPR, as the result is not forced. Using `return $!` makes this work.
|
|
- `facIO` in #1600: Not eligible for nested CPR, as the result is not forced. Using `return $!` makes this work.
|
|
- `mean` in [\#2289](https://gitlab.haskell.org/ghc/ghc/issues/2289): Not eligible for nested CRP. The base case `go x l s | x > m = P s l` is – to the demand analyzer – lazy in `s` and `l`, so doing nested CRP would make that stricter. It works with `s `seq` l `seq` P s`. But `P` *is* a strict constructor! When the demand analyser runs, it still sees the wrapper `$WP`. Maybe it just needs to be inlined earlier? Tried inlining more aggressively, helps, and does not seem to hurt.
|
|
- `mean` in #2289: Not eligible for nested CRP. The base case `go x l s | x > m = P s l` is – to the demand analyzer – lazy in `s` and `l`, so doing nested CRP would make that stricter. It works with `s `seq` l `seq` P s`. But `P` *is* a strict constructor! When the demand analyser runs, it still sees the wrapper `$WP`. Maybe it just needs to be inlined earlier? Tried inlining more aggressively, helps, and does not seem to hurt.
|
|
- [\#2387](https://gitlab.haskell.org/ghc/ghc/issues/2387) works nicely! (but note that `go` uses a `!n` pattern already)
|
|
- #2387 works nicely! (but note that `go` uses a `!n` pattern already)
|
|
|
|
|
|
### Degradation exploration and explanation
|
|
### Degradation exploration and explanation
|
|
|
|
|
... | @@ -163,7 +163,7 @@ Idea to fix this, and possibly more general benefits: |
... | @@ -163,7 +163,7 @@ Idea to fix this, and possibly more general benefits: |
|
#### Direct detection
|
|
#### Direct detection
|
|
|
|
|
|
|
|
|
|
Alternative: Detect join points during `dmdAnal` and make sure that their CPR info is not greater than that of the expression they are a join-point for. Would also fix [\#5075](https://gitlab.haskell.org/ghc/ghc/issues/5075), see [5075\#comment:19](https://gitlab.haskell.org/ghc/ghc/issues/5075) for benchmark numbers.
|
|
Alternative: Detect join points during `dmdAnal` and make sure that their CPR info is not greater than that of the expression they are a join-point for. Would also fix #5075, see [5075\#comment:19](https://gitlab.haskell.org/ghc/ghc/issues/5075) for benchmark numbers.
|
|
|
|
|
|
- On its own, no changes.
|
|
- On its own, no changes.
|
|
- Enabling CPR for sumtypes: (min -3.8%, mean -0.0%, max 1.7%) (slightly better than with Common Context)
|
|
- Enabling CPR for sumtypes: (min -3.8%, mean -0.0%, max 1.7%) (slightly better than with Common Context)
|
... | @@ -187,21 +187,21 @@ Might also help. Need to see if his branch can be merged onto master. (But I lik |
... | @@ -187,21 +187,21 @@ Might also help. Need to see if his branch can be merged onto master. (But I lik |
|
- ~~Use `Converges` in `exprOkForSpeculation`: Mostly done, see [8655\#comment:8](https://gitlab.haskell.org/ghc/ghc/issues/8655).~~
|
|
- ~~Use `Converges` in `exprOkForSpeculation`: Mostly done, see [8655\#comment:8](https://gitlab.haskell.org/ghc/ghc/issues/8655).~~
|
|
|
|
|
|
- I should get dynamic numbers, but given the static ones I doubt that these are worth collecting.
|
|
- I should get dynamic numbers, but given the static ones I doubt that these are worth collecting.
|
|
- Why is `cacheprof` not deterministic? (→ [\#8611](https://gitlab.haskell.org/ghc/ghc/issues/8611))
|
|
- Why is `cacheprof` not deterministic? (→ #8611)
|
|
- What became of Simon’s better-ho-cardinality branch? See [better-ho-cardinality](nested-cpr/better-ho-cardinality).
|
|
- What became of Simon’s better-ho-cardinality branch? See [better-ho-cardinality](nested-cpr/better-ho-cardinality).
|
|
- Try vtunes to get better numbers.
|
|
- Try vtunes to get better numbers.
|
|
- ~~Implement [\#2110](https://gitlab.haskell.org/ghc/ghc/issues/2110)~~ (pushed)
|
|
- ~~Implement #2110~~ (pushed)
|
|
- ~~Make worker-wrapper unbox data families: [\#7619](https://gitlab.haskell.org/ghc/ghc/issues/7619)~~
|
|
- ~~Make worker-wrapper unbox data families: #7619~~
|
|
- ~~Make foldl into a good consumer: [\#7994](https://gitlab.haskell.org/ghc/ghc/issues/7994)~~ (pushed)
|
|
- ~~Make foldl into a good consumer: #7994~~ (pushed)
|
|
|
|
|
|
- Ideas: [DmdAnalIdeas](nested-cpr/dmd-anal-ideas) ← Outdated
|
|
- Ideas: [DmdAnalIdeas](nested-cpr/dmd-anal-ideas) ← Outdated
|
|
- Related: See how often the demand on a function is better than its vanilla demand ([\#6070](https://gitlab.haskell.org/ghc/ghc/issues/6070))
|
|
- Related: See how often the demand on a function is better than its vanilla demand (#6070)
|
|
- ~~Clean up my new shiny Caller Arity analysis.~~
|
|
- ~~Clean up my new shiny Caller Arity analysis.~~
|
|
- Investigate in Takano’s WW-stuff.
|
|
- Investigate in Takano’s WW-stuff.
|
|
|
|
|
|
- Mail with question sent
|
|
- Mail with question sent
|
|
- He is investigating nofib regressions.
|
|
- He is investigating nofib regressions.
|
|
- Experiment with aggressive CSE: [\#7596](https://gitlab.haskell.org/ghc/ghc/issues/7596)
|
|
- Experiment with aggressive CSE: #7596
|
|
|
|
|
|
- Prevent floating past multi-way cases.
|
|
- Prevent floating past multi-way cases.
|
|
- Experiment with CSE before and after DmdAnal. |
|
- Experiment with CSE before and after DmdAnal. |