[Git][ghc/ghc][wip/cfuneqcan-refactor] 90 commits: Move core flattening algorithm to Core.Unify

Richard Eisenberg gitlab at gitlab.haskell.org
Wed Nov 25 04:21:23 UTC 2020



Richard Eisenberg pushed to branch wip/cfuneqcan-refactor at Glasgow Haskell Compiler / GHC


Commits:
ea4662fc by Richard Eisenberg at 2020-11-24T23:19:55-05:00
Move core flattening algorithm to Core.Unify

This sets the stage for a later change, where this
algorithm will be needed from GHC.Core.InstEnv.

This commit also splits GHC.Core.Map into
GHC.Core.Map.Type and GHC.Core.Map.Expr,
in order to avoid module import cycles
with GHC.Core.

- - - - -
91fa4b47 by Richard Eisenberg at 2020-11-24T23:20:17-05:00
Bump the # of commits searched for perf baseline

The previous value of 75 meant that a feature branch with
more than 75 commits would get spurious CI passes.

This affects #18692, but does not fix that ticket, because
if a baseline cannot be found, we should fail, not succeed.

- - - - -
25bc67ab by Richard Eisenberg at 2020-11-24T23:20:17-05:00
Start of work in simplifying flattening

- - - - -
c3806e5a by Richard Eisenberg at 2020-11-24T23:20:17-05:00
Much work toward simplifying CFunEqCan

- - - - -
3dface62 by Richard Eisenberg at 2020-11-24T23:20:17-05:00
Canonicalized function equalities.

Now, onto interactions.

- - - - -
7d254133 by Richard Eisenberg at 2020-11-24T23:20:17-05:00
CEqCan, and canonicalization for it

- - - - -
a22102d9 by Richard Eisenberg at 2020-11-24T23:20:17-05:00
Main changes done. Now to delete code.

- - - - -
dee0c256 by Richard Eisenberg at 2020-11-24T23:20:18-05:00
Kill off CFunEqCan and CTyEqCan

- - - - -
a3e0f6cf by Richard Eisenberg at 2020-11-24T23:20:18-05:00
It compiles.

- - - - -
75893891 by Richard Eisenberg at 2020-11-24T23:20:18-05:00
Some bugfixing

- - - - -
56ee9cee by Richard Eisenberg at 2020-11-24T23:20:18-05:00
Lots of bug fixing

- - - - -
b59b65bc by Richard Eisenberg at 2020-11-24T23:20:18-05:00
Expand synonyms that mention families, obvs

- - - - -
920855a2 by Richard Eisenberg at 2020-11-24T23:20:18-05:00
Super skolems are really super.

- - - - -
06cb3183 by Richard Eisenberg at 2020-11-24T23:20:19-05:00
Another bug bites the dust.

- - - - -
f362ea5a by Richard Eisenberg at 2020-11-24T23:20:19-05:00
Put variable on left only when it will unify

- - - - -
3ec0aaa1 by Richard Eisenberg at 2020-11-24T23:20:19-05:00
Tiny little changes

- - - - -
d2a3edb4 by Richard Eisenberg at 2020-11-24T23:20:19-05:00
Use built-in axioms for injectivity

- - - - -
449e25ef by Richard Eisenberg at 2020-11-24T23:20:19-05:00
Stop loop in solver due to blocked hetero eqs

- - - - -
83b162bb by Richard Eisenberg at 2020-11-24T23:20:20-05:00
Note [Runaway Derived rewriting]

- - - - -
0e087f2e by Richard Eisenberg at 2020-11-24T23:20:20-05:00
Still need to check tyvar/funeq orientation

- - - - -
67c8acfe by Richard Eisenberg at 2020-11-24T23:20:49-05:00
More bugfixing

- - - - -
22711aa3 by Richard Eisenberg at 2020-11-24T23:20:52-05:00
Orient FunEq/FunEq correctly wrt occurs-check

- - - - -
bf1eb58c by Richard Eisenberg at 2020-11-24T23:20:53-05:00
Fix import

- - - - -
287e969c by Richard Eisenberg at 2020-11-24T23:20:53-05:00
Note [Type variable cycles in Givens]

- - - - -
4f629ab2 by Richard Eisenberg at 2020-11-24T23:20:53-05:00
Handle obscure corner case in canonicalize

- - - - -
72556f8f by Richard Eisenberg at 2020-11-24T23:20:53-05:00
Handle (=>) specially in pure unifier

- - - - -
51418692 by Richard Eisenberg at 2020-11-24T23:20:53-05:00
Start deleting stuff. Hooray!

- - - - -
ac4b7d52 by Richard Eisenberg at 2020-11-24T23:20:53-05:00
Fix test output

- - - - -
ec2cd9c7 by Richard Eisenberg at 2020-11-24T23:20:54-05:00
Delete delete delete !!

- - - - -
ab084222 by Richard Eisenberg at 2020-11-24T23:20:54-05:00
More deleting. Checkpoint before removing FlattenMode

- - - - -
3281640b by Richard Eisenberg at 2020-11-24T23:20:54-05:00
Remove FlattenMode

- - - - -
a1727684 by Richard Eisenberg at 2020-11-24T23:20:54-05:00
Stopped bumping ctLocDepth in runFlatten

- - - - -
d30ff3ef by Richard Eisenberg at 2020-11-24T23:20:54-05:00
Finished deleting.

- - - - -
79084542 by Richard Eisenberg at 2020-11-24T23:20:55-05:00
A few error message wibbles

- - - - -
86c7462d by Richard Eisenberg at 2020-11-24T23:20:55-05:00
Some small changes, mostly comments.

- - - - -
d989a125 by Richard Eisenberg at 2020-11-24T23:20:55-05:00
Fix #18875 by breaking type variable cycles.

- - - - -
a6437cf9 by Richard Eisenberg at 2020-11-24T23:20:55-05:00
Actually add test files

- - - - -
9bd983b7 by Richard Eisenberg at 2020-11-24T23:20:55-05:00
Add Detail (7) to the Note

- - - - -
c7fc940b by Richard Eisenberg at 2020-11-24T23:20:55-05:00
A few error wibbles

- - - - -
1391322f by Richard Eisenberg at 2020-11-24T23:20:56-05:00
Don't simplify extra-constraint holes

- - - - -
9464e344 by Richard Eisenberg at 2020-11-24T23:20:56-05:00
Subtleties in Note [Instance and Given overlap]

- - - - -
fc073a19 by Richard Eisenberg at 2020-11-24T23:20:56-05:00
Update Note [TyVar/TyVar orientation]

- - - - -
61d2cfda by Richard Eisenberg at 2020-11-24T23:20:56-05:00
Actually add tests

- - - - -
285d8d29 by Richard Eisenberg at 2020-11-24T23:20:56-05:00
Do mightMatchLater correctlier.

- - - - -
1fd7947a by Richard Eisenberg at 2020-11-24T23:20:57-05:00
Simplify getNoGivenEqs

- - - - -
a6e126bd by Richard Eisenberg at 2020-11-24T23:20:57-05:00
Simplify code a bit

- - - - -
a827fbd1 by Richard Eisenberg at 2020-11-24T23:20:57-05:00
Introduce 3-way for ic_given_eqs

- - - - -
73c055c6 by Richard Eisenberg at 2020-11-24T23:20:57-05:00
test LocalGivenEqs

- - - - -
3fdaeadf by Richard Eisenberg at 2020-11-24T23:20:57-05:00
Update commentary about HasGivenEqs

- - - - -
e12e6e13 by Richard Eisenberg at 2020-11-24T23:20:57-05:00
Update notes.

- - - - -
aa1abe28 by Richard Eisenberg at 2020-11-24T23:20:58-05:00
More documentation around LocalGivenEqs

- - - - -
c52b30e2 by Richard Eisenberg at 2020-11-24T23:20:58-05:00
Rename the flat-cache. Document it, too.

- - - - -
cf01300a by Richard Eisenberg at 2020-11-24T23:20:58-05:00
Make EqualCtList into a newtype with NonEmpty

- - - - -
210414e3 by Richard Eisenberg at 2020-11-24T23:20:58-05:00
Remove Note [No FunEq improvement for Givens]

- - - - -
1d494b14 by Richard Eisenberg at 2020-11-24T23:20:58-05:00
Fix compilation errors from rebasing

- - - - -
36f7db05 by Richard Eisenberg at 2020-11-24T23:20:58-05:00
Use DTyConEnv for TcAppMap instead of UDFM

- - - - -
405cd093 by Richard Eisenberg at 2020-11-24T23:20:59-05:00
Remove mention of CFunEqCan from rebasing

- - - - -
8ba8d46a by Richard Eisenberg at 2020-11-24T23:20:59-05:00
Fix error output

- - - - -
25b82e52 by Richard Eisenberg at 2020-11-24T23:20:59-05:00
Reimplement flatten_exact_fam_app

Hopefully will be faster?

- - - - -
0a013b3b by Richard Eisenberg at 2020-11-24T23:20:59-05:00
Improve performance

- - - - -
fcc45013 by Richard Eisenberg at 2020-11-24T23:20:59-05:00
Don't fail eagerly on runaway Derived instances

- - - - -
ed274fcb by Richard Eisenberg at 2020-11-24T23:20:59-05:00
Improve some comments

- - - - -
9f373dc4 by Richard Eisenberg at 2020-11-24T23:21:00-05:00
Checkpoint before adding filterTM

- - - - -
d76dc2f9 by Richard Eisenberg at 2020-11-24T23:21:00-05:00
remove stale givens from famapp-cache

- - - - -
81efda55 by Richard Eisenberg at 2020-11-24T23:21:00-05:00
Remove unused parameter

- - - - -
0b2ea8c4 by Richard Eisenberg at 2020-11-24T23:21:00-05:00
Address points from Hécate.

- - - - -
546c58cb by Richard Eisenberg at 2020-11-24T23:21:00-05:00
Reviews on GitLab

- - - - -
c576c273 by Richard Eisenberg at 2020-11-24T23:21:01-05:00
Use tcSplitTyConApp_maybe in can_eq_nc'

- - - - -
bb7a7ce0 by Richard Eisenberg at 2020-11-24T23:21:01-05:00
Try removing (2b). Let's see what the testsuite says

- - - - -
b1599c78 by Richard Eisenberg at 2020-11-24T23:21:01-05:00
Really remove (2b)

- - - - -
70637438 by Richard Eisenberg at 2020-11-24T23:21:01-05:00
More reactions to reviews

- - - - -
1e4e66f7 by Richard Eisenberg at 2020-11-24T23:21:01-05:00
Revisit [Prevent unification with type families]

- - - - -
bde84897 by Richard Eisenberg at 2020-11-24T23:21:01-05:00
Don't flatten during instance lookup

- - - - -
081c00ad by Richard Eisenberg at 2020-11-24T23:21:02-05:00
Comments, etc., from Friday

- - - - -
d5d8ce80 by Richard Eisenberg at 2020-11-24T23:21:02-05:00
Make the fast path work without roles

- - - - -
48963372 by Richard Eisenberg at 2020-11-24T23:21:02-05:00
Use MCo

- - - - -
d1c1600f by Richard Eisenberg at 2020-11-24T23:21:02-05:00
Remove unused parameter

- - - - -
2036eecc by Richard Eisenberg at 2020-11-24T23:21:02-05:00
Add test case

- - - - -
5fd9c466 by Richard Eisenberg at 2020-11-24T23:21:03-05:00
s/flatten/rewrite`

- - - - -
bb01cdb7 by Richard Eisenberg at 2020-11-24T23:21:03-05:00
inline finish

- - - - -
e00f2ebd by Richard Eisenberg at 2020-11-24T23:21:03-05:00
Use a flag on `finish`

- - - - -
5adfd0ec by Richard Eisenberg at 2020-11-24T23:21:03-05:00
Don't avoid adding inerts to cache

- - - - -
8623f3bb by Richard Eisenberg at 2020-11-24T23:21:03-05:00
Kill off Note [Unification with skolems]

- - - - -
dee56d9f by Richard Eisenberg at 2020-11-24T23:21:03-05:00
Introduce canNC

- - - - -
6df1bfd6 by Richard Eisenberg at 2020-11-24T23:21:04-05:00
Remove isTyVarHead

- - - - -
7efceb85 by Richard Eisenberg at 2020-11-24T23:21:04-05:00
Accommodate #18987

- - - - -
d3d30796 by Richard Eisenberg at 2020-11-24T23:21:04-05:00
let-bound skolems

- - - - -
853dd86b by Richard Eisenberg at 2020-11-24T23:21:04-05:00
More comments on HasGivenEqs

- - - - -
0bb0e32a by Richard Eisenberg at 2020-11-24T23:21:04-05:00
Fix error output

- - - - -
c417aa24 by Richard Eisenberg at 2020-11-24T23:21:04-05:00
Some comments

- - - - -


30 changed files:

- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs
- + compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Map.hs → compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Data/TrieMap.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Types.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Stg/CSE.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/Bind.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2b7af3cd500bb587736ff455645fb4cd5ff986f3...c417aa249c71e29dfb3f976076d722be88c05fe6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2b7af3cd500bb587736ff455645fb4cd5ff986f3...c417aa249c71e29dfb3f976076d722be88c05fe6
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201124/b4996966/attachment-0001.html>


More information about the ghc-commits mailing list