... | ... | @@ -53,7 +53,7 @@ Main ticket: #18174, MR !1866. Blocked on #18894 |
|
|
- Interleave CPR and Termination analysis or not? See also https://gitlab.haskell.org/ghc/ghc/-/merge_requests/1866#note_304163
|
|
|
- Also my "speculation analysis" proposal. Nested CPR could be made more aggressive by looking at call sites strictness. But that probably needs a refactoring of `Demand`.
|
|
|
|
|
|
## Eta expansion
|
|
|
# Eta expansion
|
|
|
|
|
|
- #18993: regression in 9.1 due to eta-expansion
|
|
|
|
... | ... | @@ -81,7 +81,7 @@ Main ticket: #18174, MR !1866. Blocked on #18894 |
|
|
- In some situations, we want one, in some we want the other!
|
|
|
- Idea: No eta reduction whenever there's os or ms, only if there is no annotation
|
|
|
|
|
|
## PmCheck
|
|
|
# PmCheck
|
|
|
|
|
|
- #14422, #18277, !3959: Disattach COMPLETE pragmas from TyCons
|
|
|
- This allows "polymorphic" use, for example `pattern P :: C f => f a`, `{-#
|
... | ... | @@ -90,64 +90,23 @@ Main ticket: #18174, MR !1866. Blocked on #18894 |
|
|
- But doesn't actually fix #14422, which actually wants disambiguation by
|
|
|
type signatures. Also a user complains there.
|
|
|
|
|
|
## Misc
|
|
|
|
|
|
- #19001: float-out and case-expressions. Quick win here?
|
|
|
- #17900, !3013: primop effects
|
|
|
- #17881, #17896: eta reduction (based on usage Demand)
|
|
|
|
|
|
- #18174, !1866: Nested CPR. See below
|
|
|
|
|
|
# Pattern-match checking
|
|
|
|
|
|
## Patches
|
|
|
|
|
|
Those with an MR actually have code.
|
|
|
|
|
|
- Clean up `provideEvidence`, define `ensureInhabited delta = null <$> provideEvidence 1 delta`
|
|
|
- !1975 featured a rewrite, which makes for better warning messages
|
|
|
- But `provideEvidence` currently assumes that every COMPLETE set is inhabited, and thus implicitly assumes that `ensureInhabited` is true for that data type. So we can't actually just re-define it in terms of the other just yet.
|
|
|
- `provideEvidence` currently picks the smallest residual COMPLETE set for reports. But it doesn't consider type information! So it may indeed happen that we pick a residual COMPLETE set that looks smaller (say, size 2) and is still inhabited in favor of one that disregarding type info looks bigger (size 3) but actually only 1 is inhabited. For the same reason, we can't use `provideEvidence` as a replacement for `ensureInhabited`.
|
|
|
- It *is* possible to make `provideEvidence` behave appropriately to replace `ensureInhabited`, but it's not very efficient. Also `ensureInhabited` is entirely orthogonal to what `provideEvidence` does. Think of recursive data types, for example: `provideEvidence` doesn't attempt to recurse *at all*. It just doesn't make for good warning messages.
|
|
|
|
|
|
- #17378, !1765: Preserve non-void constraints
|
|
|
- Should not remove inhabitation candidate stuff just yet, newtypes...
|
|
|
- Perhpas postpone test until get to RHS (pmc []), and then ask for `not (null (provideEvidence 1 delta))`
|
|
|
# Ideas
|
|
|
|
|
|
- Implement "smarter `CoreMap`"
|
|
|
- Test for "N series" (Matching over a binary tree, like the code generated by `-XDeriveGeneric`)
|
|
|
|
|
|
## Issues
|
|
|
# Issues
|
|
|
|
|
|
- #19001: float-out and case-expressions. Quick win here?
|
|
|
- #17900, !3013: primop effects
|
|
|
- #17881, #17896: eta reduction (based on usage Demand)
|
|
|
- #18174, !1866: Nested CPR. See above
|
|
|
- #15532: Levity polymorphism and ANF
|
|
|
- We talked about it with Richard and came to the understanding that it would probably work, but entail refactorings of Core to Core passes which assume they can just let-bind everything.
|
|
|
- Also we shouldn't worry about it until we need it. But it's a logical next step after we have unlifted datatypes, otherwise there is no chance of code re-use.
|
|
|
|
|
|
## Epics
|
|
|
|
|
|
- Think about how to fix "regression" in T11822
|
|
|
- SG bets a smart `CoreMap` would do
|
|
|
- Maybe pattern-match check typed TH quotations? SG doesn't think this is a good idea, because they might not even end up in that form in spliced code.
|
|
|
- Can we check if a clause is uniform? E.g. can be moved around (more or less) freely, up or down.
|
|
|
- I think we can, by trying to move up the clause and see if its new Covered set has a non-empty intersection (e.g. overlaps) with the clause that was previously there. Example:
|
|
|
```haskell
|
|
|
data T = A | B | C
|
|
|
f (Just False) = ()
|
|
|
f Nothing = ()
|
|
|
f (Just _) = ()
|
|
|
```
|
|
|
If we try to move the third clause up once, it covers the left over `Just True`. The second clause covers `Nothing`, so the two clauses don't overlap. If we try to move up the third clause to the top, it suddenly covers `Just _`, which overlaps with `Just False` from the actual first clause. So we may switch second and third clause but not move the third clause to the top.
|
|
|
- This is very similar to redundancy checking, but in redundancy checking we see if we *completely* overlap the pattern. Here, we see if their Covered sets overlap *at all* instead of seeing if one completely covers the other.
|
|
|
- I suppose this also has tricky interactions with bottom. But our existing machinery should cover it.
|
|
|
|
|
|
## Roadblocks
|
|
|
|
|
|
- T9291: unsafePtrEquality checks for STG CSE
|
|
|
- `bar x = (Right x, Right x)` gets CPR'd, `$wbar x = (# x, x #)` can't CSE at call site. Fixed testcase with `lazy`, but is that the right thing to do?
|
|
|
- integerConstantFolding: `CONSTANT_FOLDED` on `decodeDoubleInteger`, but gets WW'd because of nested `Int64`
|
|
|
- We can't really just return the unboxed Int#, because that's platform dependent. BUT we could return Int64# instead
|
|
|
- Alternatively, inline `decodeIntegerDouble` and recognise the PrimOp, seems like the much saner behavior?!
|
|
|
|
|
|
# On hold
|
|
|
|
|
|
- https://gitlab.haskell.org/ghc/ghc/tree/wip/ext-arity: Rebased Zach's implementation of the extensionality paper
|
... | ... | @@ -183,7 +142,7 @@ Those with an MR actually have code. |
|
|
- We talked about it; it's a matter of pushing the proposal forward rather than investing actual elbow grease into an impl.
|
|
|
|
|
|
- !2218 Unlifted data types
|
|
|
- Wait for BoxedRep !2249
|
|
|
- Wait for BoxedRep !4612
|
|
|
|
|
|
# Done
|
|
|
|
... | ... | |