[Git][ghc/ghc][wip/t22707] 24 commits: Don't specialise incoherent instance applications

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Fri Mar 3 08:20:21 UTC 2023



Simon Peyton Jones pushed to branch wip/t22707 at Glasgow Haskell Compiler / GHC


Commits:
b56025f4 by Gergő Érdi at 2023-02-27T13:34:22+00:00
Don't specialise incoherent instance applications

Using incoherent instances, there can be situations where two
occurrences of the same overloaded function at the same type use two
different instances (see #22448). For incoherently resolved instances,
we must mark them with `nospec` to avoid the specialiser rewriting one
to the other. This marking is done during the desugaring of the
`WpEvApp` wrapper.

Fixes #22448

Metric Increase:
    T15304

- - - - -
d0c7bbed by Tom Ellis at 2023-02-27T20:04:07-05:00
Fix SCC grouping example

- - - - -
f84a8cd4 by Bryan Richter at 2023-02-28T05:58:37-05:00
Mark setnumcapabilities001 fragile

- - - - -
29a04d6e by Bryan Richter at 2023-02-28T05:58:37-05:00
Allow nightly-x86_64-linux-deb10-validate+thread_sanitizer to fail

See #22520

- - - - -
9fa54572 by Cheng Shao at 2023-02-28T05:59:15-05:00
ghc-prim: fix hs_cmpxchg64 function prototype

hs_cmpxchg64 must return a StgWord64, otherwise incorrect runtime
results of 64-bit MO_Cmpxchg will appear in 32-bit unregisterised
builds, which go unnoticed at compile-time due to C implicit casting
in .hc files.

- - - - -
0c200ab7 by Simon Peyton Jones at 2023-02-28T11:10:31-05:00
Account for local rules in specImports

As #23024 showed, in GHC.Core.Opt.Specialise.specImports, we were
generating specialisations (a locally-define function) for imported
functions; and then generating specialisations for those
locally-defined functions.  The RULE for the latter should be
attached to the local Id, not put in the rules-for-imported-ids
set.

Fix is easy; similar to what happens in GHC.HsToCore.addExportFlagsAndRules

- - - - -
8b77f9bf by Sylvain Henry at 2023-02-28T11:11:21-05:00
JS: fix for overlap with copyMutableByteArray# (#23033)

The code wasn't taking into account some kind of overlap.

cgrun070 has been extended to test the missing case.

- - - - -
239202a2 by Sylvain Henry at 2023-02-28T11:12:03-05:00
Testsuite: replace some js_skip with req_cmm

req_cmm is more informative than js_skip

- - - - -
7192ef91 by Simon Peyton Jones at 2023-02-28T18:54:59-05:00
Take more care with unlifted bindings in the specialiser

As #22998 showed, we were floating an unlifted binding to top
level, which breaks a Core invariant.

The fix is easy, albeit a little bit conservative.  See
Note [Care with unlifted bindings] in GHC.Core.Opt.Specialise

- - - - -
bb500e2a by Simon Peyton Jones at 2023-02-28T18:55:35-05:00
Account for TYPE vs CONSTRAINT in mkSelCo

As #23018 showed, in mkRuntimeRepCo we need to account for coercions
between TYPE and COERCION.

See Note [mkRuntimeRepCo] in GHC.Core.Coercion.

- - - - -
79ffa170 by Ben Gamari at 2023-03-01T04:17:20-05:00
hadrian: Add dependency from lib/settings to mk/config.mk

In 81975ef375de07a0ea5a69596b2077d7f5959182 we attempted to fix #20253
by adding logic to the bindist Makefile to regenerate the `settings`
file from information gleaned by the bindist `configure` script.
However, this fix had no effect as `lib/settings` is shipped in the
binary distribution (to allow in-place use of the binary distribution).
As `lib/settings` already existed and its rule declared no dependencies,
`make` would fail to use the added rule to regenerate it.

Fix this by explicitly declaring a dependency from `lib/settings` on
`mk/config.mk`.

Fixes #22982.

- - - - -
a2a1a1c0 by Sebastian Graf at 2023-03-01T04:17:56-05:00
Revert the main payload of "Make `drop` and `dropWhile` fuse (#18964)"

This reverts the bits affecting fusion of `drop` and `dropWhile` of commit
0f7588b5df1fc7a58d8202761bf1501447e48914 and keeps just the small refactoring
unifying `flipSeqTake` and `flipSeqScanl'` into `flipSeq`.

It also adds a new test for #23021 (which was the reason for reverting) as
well as adds a clarifying comment to T18964.

Fixes #23021, unfixes #18964.

Metric Increase:
    T18964
Metric Decrease:
    T18964

- - - - -
cf118e2f by Simon Peyton Jones at 2023-03-01T04:18:33-05:00
Refine the test for naughty record selectors

The test for naughtiness in record selectors is surprisingly subtle.
See the revised Note [Naughty record selectors] in GHC.Tc.TyCl.Utils.

Fixes #23038.

- - - - -
86f240ca by romes at 2023-03-01T04:19:10-05:00
fix: Consider strictness annotation in rep_bind

Fixes #23036

- - - - -
1ed573a5 by Richard Eisenberg at 2023-03-02T22:42:06-05:00
Don't suppress *all* Wanteds

Code in GHC.Tc.Errors.reportWanteds suppresses a Wanted if its
rewriters have unfilled coercion holes; see
Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint.

But if we thereby suppress *all* errors that's really confusing,
and as #22707 shows, GHC goes on without even realising that the
program is broken. Disaster.

This MR arranges to un-suppress them all if they all get suppressed.

Close #22707

- - - - -
8919f341 by Luite Stegeman at 2023-03-02T22:42:45-05:00
Check for platform support for JavaScript foreign imports

GHC was accepting `foreign import javascript` declarations
on non-JavaScript platforms. This adds a check so that these
are only supported on an platform that supports the JavaScript
calling convention.

Fixes #22774

- - - - -
db83f8bb by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Statically assert alignment of Capability

In #22965 we noticed that changes in the size of `Capability` can result
in unsound behavior due to the `align` pragma claiming an alignment
which we don't in practice observe. Avoid this by statically asserting
that the size is a multiple of the alignment.

- - - - -
5f7a4a6d by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Introduce stgMallocAlignedBytes

- - - - -
8a6f745d by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Correctly align Capability allocations

Previously we failed to tell the C allocator that `Capability`s needed
to be aligned, resulting in #22965.

Fixes #22965.
Fixes #22975.

- - - - -
5464c73f by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Drop no-alignment special case for Windows

For reasons that aren't clear, we were previously not giving Capability
the same favorable alignment on Windows that we provided on other
platforms. Fix this.

- - - - -
a86aae8b by Matthew Pickering at 2023-03-02T22:43:59-05:00
constant folding: Correct type of decodeDouble_Int64 rule

The first argument is Int64# unconditionally, so we better produce
something of that type. This fixes a core lint error found in the ad
package.

Fixes #23019

- - - - -
68dd64ff by Zubin Duggal at 2023-03-02T22:44:35-05:00
ncg/aarch64: Handle MULTILINE_COMMENT identically as COMMENTs

Commit 7566fd9de38c67360c090f828923d41587af519c with the fix for #22798 was
incomplete as it failed to handle MULTILINE_COMMENT pseudo-instructions, and
didn't completly fix the compiler panics when compiling with `-fregs-graph`.

Fixes #23002

- - - - -
2f97c861 by Simon Peyton Jones at 2023-03-02T22:45:11-05:00
Get the right in-scope set in etaBodyForJoinPoint

Fixes #23026

- - - - -
e4c03dc2 by Simon Peyton Jones at 2023-03-03T08:21:22+00:00
Add test for T22793

- - - - -


30 changed files:

- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Binds.hs-boot
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Constructor.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Types.hs
- compiler/GHC/StgToJS/Prim.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Canonical.hs
- compiler/GHC/Tc/Solver/Interact.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f65f8bf85230f474569d3d611b1b26d87cf020df...e4c03dc2ac368030debdf6e6e516f6315bb8e362

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f65f8bf85230f474569d3d611b1b26d87cf020df...e4c03dc2ac368030debdf6e6e516f6315bb8e362
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/20230303/b2c52ad8/attachment-0001.html>


More information about the ghc-commits mailing list