[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 8 commits: Skip type family defaults with hs-boot and hsig files

Marge Bot gitlab at gitlab.haskell.org
Sat Oct 17 01:20:24 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
117f2517 by John Ericson at 2020-10-16T21:20:04-04:00
Skip type family defaults with hs-boot and hsig files

Works around #17190, possible resolution for #17224. New design is is
according to accepted [GHC Propoal 320].

Instances in signatures currently unconditionally opt into associated
family defaults if no explicit instance is given. This is bad for two
reasons:

  1. It constrains possible instantiations to use the default, rather
  than possibly define the associated family differently.

  2. It breaks compilation as type families are unsupported in
  signatures.

This PR simply turns off the filling in of defaults in those cases.
Additionally, it squelches a missing definition warning for hs-boot too
that was only squelched for hsig before.

The downsides are:

  1. There is no way to opt into the default, other than copying its
  definition.

  2. If we fixed type classes in signatures, and wanted instances to
  have to explicitly *out of* rather than into the default, that would
  now be a breaking change.

The change that is most unambiguously goood is harmonizing the warning
squelching between hs-boot or hsig. Maybe they should have the warning
(opt out of default) maybe they shouldn't (opt in to default), but
surely it should be the same for both.

Add hs-boot version of a backpack test regarding class-specified
defaults in instances that appear in an hs-boot file.

The metrics increase is very slight and makes no sense --- at least no
one has figured anything out after this languishing for a while, so I'm
just going to accept it.

Metric Increase:
  T10421a

[GHC proposal 320]: https://github.com/ghc-proposals/ghc-proposals/pull/320

- - - - -
c321d57b by Sebastian Graf at 2020-10-16T21:20:05-04:00
Arity: Refactor fixed-point iteration in GHC.Core.Opt.Arity

Arity analysis used to propagate optimistic arity types during
fixed-point interation through the `ArityEnv`'s `ae_cheap_fun` field,
which is like `GHC.Core.Utils.exprIsCheap`, but also considers the
current iteration's optimistic arity, for the binder in question only.

In #18793, we have seen that this is a problematic design, because it
doesn't allow us to look through PAP bindings of that binder.

Hence this patch refactors to a more traditional form with an explicit
signature environment, in which we record the optimistic `ArityType` of
the binder in question (and at the moment is the *only* binder that is
recorded in the arity environment).

- - - - -
32b13955 by Sebastian Graf at 2020-10-16T21:20:05-04:00
Arity: Record arity types for non-recursive lets

In #18793, we saw a compelling example which requires us to look at
non-recursive let-bindings during arity analysis and unleash their arity
types at use sites.

After the refactoring in the previous patch, the needed change is quite
simple and very local to `arityType`'s defn for non-recurisve `Let`.

Apart from that, we had to get rid of the second item of
`Note [Dealing with bottoms]`, which was entirely a safety measure and
hindered optimistic fixed-point iteration.

Fixes #18793.

The following metric increases are all caused by this commit and a
result of the fact that we just do more work now:

Metric Increase:
    T3294
    T12545
    T12707

- - - - -
15c68001 by Sebastian Graf at 2020-10-16T21:20:05-04:00
Testsuite: Add dead arity analysis tests

We didn't seem to test these old tests at all, judging from their
expected output.

- - - - -
8526d4de by Dylan Yudaken at 2020-10-16T21:20:09-04:00
When using rts_setInCallCapability, lock incall threads

This diff makes sure that incall threads, when using `rts_setInCallCapability`, will be created as locked.
If the thread is not locked, the thread might end up being scheduled to a different capability.
While this is mentioned in the docs for `rts_setInCallCapability,`, it makes the method significantly less useful as there is no guarantees on the capability being used.

This commit also adds a test to make sure things stay on the correct capability.

- - - - -
a07adfc3 by DylanZA at 2020-10-16T21:20:09-04:00
Apply suggestion to testsuite/tests/ffi/should_run/all.T
- - - - -
29948821 by Sylvain Henry at 2020-10-16T21:20:12-04:00
Don't get host RTS ways via settings (#18651)

To correctly perform a linking hack for Windows we need to link with the
RTS GHC is currently using. We used to query the RTS ways via the
"settings" file but it is fragile (#18651). The hack hasn't been fixed
to take into account all the ways (Tracing) and it makes linking of GHC
with another RTS more difficult (we need to link with another RTS and to
regenerate the settings file).

So this patch uses the ways reported by the RTS itself
(GHC.Platform.Ways.hostWays) instead of the "settings" file.

- - - - -
29ec47e9 by Hécate at 2020-10-16T21:20:13-04:00
Linting corrections

* Bring back LANGUAGE pragmas in GHC.IO.Handle.Lock.Windows
* Exclude some modules that are wrongfully reported

- - - - -


30 changed files:

- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/SysTools.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- hadrian/src/Rules/Generate.hs
- includes/RtsAPI.h
- includes/ghc.mk
- libraries/base/.hlint.yaml
- rts/RtsAPI.c
- rts/RtsSymbols.c
- − testsuite/tests/arityanal/Main.hs
- − testsuite/tests/arityanal/Main.stderr
- testsuite/tests/arityanal/Makefile
- − testsuite/tests/arityanal/f0.stderr
- − testsuite/tests/arityanal/f1.stderr
- − testsuite/tests/arityanal/f10.stderr
- − testsuite/tests/arityanal/f11.stderr
- − testsuite/tests/arityanal/f12.stderr
- − testsuite/tests/arityanal/f13.stderr
- − testsuite/tests/arityanal/f14.stderr
- − testsuite/tests/arityanal/f15.stderr
- − testsuite/tests/arityanal/f2.stderr
- − testsuite/tests/arityanal/f3.stderr
- − testsuite/tests/arityanal/f4.stderr
- − testsuite/tests/arityanal/f5.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/30ee2c129cd80d95600033d60761ccfb600110fe...29ec47e914fe2469bfe5043b3a1b9569e584bf55

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/30ee2c129cd80d95600033d60761ccfb600110fe...29ec47e914fe2469bfe5043b3a1b9569e584bf55
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/20201016/da6fe4e6/attachment-0001.html>


More information about the ghc-commits mailing list