<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">
<h3 style="margin-top: 20px; margin-bottom: 10px;">
Rodrigo Mesquita pushed to branch wip/romes/det-llvm at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
Commits:
</h4>
<ul>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a63ee33a116599c88e703d9793e025e17c59f7f9">a63ee33a</a></strong>
<div>
<span> by Simon Peyton Jones </span> <i> at 2024-09-25T17:08:24-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Add Given injectivity for built-in type families
Ticket #24845 asks (reasonably enough) that if we have
[G] a+b ~ 0
then we also know
[G] a ~ 0, b ~ 0
and similar injectivity-like facts for other built-in type
families. The status quo was that we never generate evidence for
injectivity among Givens -- but it is quite reasonnable to do so.
All we need is to have /evidence/ for the new constraints
This MR implements that goal. I also took the opportunity to
* Address #24978: refactoring UnivCo
* Fix #25248, which was a consequences of the previous formulation of UnivCo
As a result this MR touches a lot of code. The big things are:
* Coercion constructor UnivCo now takes a [Coercion] as argument to
express the coercions on which the UnivCo depends. A nice consequence
is that UnivCoProvenance now has no free variables, simpler in a number
of places.
* Coercion constructors AxiomInstCo and AxiomRuleCo are combined into
AxiomCo. The new AxiomCo, carries a (slightly oddly named)
CoAxiomRule, which itself is a sum type of the various forms of
built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom
A merit of this is that we can separate the case of open and closed
type families, and eliminate the redundant `BranchIndex` in the former
case.
* Much better representation for data BuiltInSynFamily, which means we
no longer need to enumerate built-in axioms as well as built-in tycons.
* There is a massive refactor in GHC.Builtin.Types.Literals, which contains all
the built-in axioms for type-level operations (arithmetic, append, cons etc).
A big change is that instead of redundantly having (a) a hand-written
matcher, and (b) a template-based "proves" function, which were hard to
keep in sync, the two are derive from one set of human-supplied info.
See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends.
* Significant changes in GHC.Tc.Solver.Equality to account for the new
opportunity for Given/Given equalities.
Smaller things
* Improve pretty-printing to avoid parens around atomic coercions.
* Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`.
Looks like a bug, Richard agrees.
* coercionLKind and coercionRKind are hot functions. I refactored the
implementation (which I had to change anyway) to increase sharing.
See Note [coercionKind performance] in GHC.Core.Coercion
* I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan
names
* I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid
calling tyConsOfType. I forget exactly why I did this, but it's definitely
better now.
* I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv
and I renamed the module GHC.Tc.Types.CtLocEnv to GHC.Tc.Types.CtLoc
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/dd8ef342bb5f050309545e89cf735d6f31c17398">dd8ef342</a></strong>
<div>
<span> by Ryan Scott </span> <i> at 2024-09-25T17:09:01-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Resolve ambiguous method-bound type variables in vanilla defaults and GND
When defining an instance of a class with a "vanilla" default, such as in the
following example (from #14266):
```hs
class A t where
f :: forall x m. Monoid x => t m -> m
f = <blah>
instance A []
```
We have to reckon with the fact that the type of `x` (bound by the type
signature for the `f` method) is ambiguous. If we don't deal with the ambiguity
somehow, then when we generate the following code:
```hs
instance A [] where
f = $dmf @[] -- NB: the type of `x` is still ambiguous
```
Then the generated code will not typecheck. (Issue #25148 is a more recent
example of the same problem.)
To fix this, we bind the type variables from the method's original type
signature using `TypeAbstractions` and instantiate `$dmf` with them using
`TypeApplications`:
```hs
instance A [] where
f @x @m = $dmf @[] @x @m -- `x` is no longer ambiguous
```
Note that we only do this for vanilla defaults and not for generic defaults
(i.e., defaults using `DefaultSignatures`). For the full details, see `Note
[Default methods in instances] (Wrinkle: Ambiguous types from vanilla method
type signatures)`.
The same problem arose in the code generated by `GeneralizedNewtypeDeriving`,
as we also fix it here using the same technique. This time, we can take
advantage of the fact that `GeneralizedNewtypeDeriving`-generated code
_already_ brings method-bound type variables into scope via `TypeAbstractions`
(after !13190), so it is very straightforward to visibly apply the type
variables on the right-hand sides of equations. See `Note [GND and ambiguity]`.
Fixes #14266. Fixes #25148.
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0a4da5d2194be981a582a805b0b01ad42ba1c76c">0a4da5d2</a></strong>
<div>
<span> by ARATA Mizuki </span> <i> at 2024-09-25T17:09:41-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Document primitive string literals and desugaring of string literals
Fixes #17474 and #17974
Co-authored-by: Matthew Craven <5086-clyring@users.noreply.gitlab.haskell.org>
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/ad0731ada00982ae66e0b5bb88ca7b97ece1313f">ad0731ad</a></strong>
<div>
<span> by Zubin Duggal </span> <i> at 2024-09-25T17:10:18-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>rts: Fix segfault when using non-moving GC with profiling
`nonMovingCollect()` swaps out the `static_flag` value used as a
sentinel for `gct->scavenged_static_objects`, but the subsequent call
`resetStaticObjectForProfiling()` sees the old value of `static_flag` used as
the sentinel and segfaults. So we must call `resetStaticObjectForProfiling()`
before calling `nonMovingCollect()` as otherwise it looks for the incorrect
sentinel value
Fixes #25232 and #23958
Also teach the testsuite driver about nonmoving profiling ways
and stop disabling metric collection when nonmoving GC is enabled.
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e7a26d7a6faf1ea534e036c5085a0a027dbb6f5f">e7a26d7a</a></strong>
<div>
<span> by Sylvain Henry </span> <i> at 2024-09-25T17:11:00-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Fix interaction between fork and kqueue (#24672)
A kqueue file descriptor isn't inherited by a child created with fork.
As such we mustn't try to close this file descriptor as we would close a
random one, e.g. the one used by timerfd.
Fix #24672
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/6863503cf3240f78549436819f20f9e1adc578d3">6863503c</a></strong>
<div>
<span> by Simon Peyton Jones </span> <i> at 2024-09-25T17:11:37-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Improve GHC.Tc.Solver.defaultEquality
This MR improves GHC.Tc.Solver.defaultEquality to solve #25251.
The main change is to use checkTyEqRhs to check the equality, so
that we do promotion properly.
But within that we needed a small enhancement to LC_Promote. See
Note [Defaulting equalites] (DE4) and (DE5)
The tricky case is (alas) hard to trigger, so I have not added a
regression test.
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/97a6c6c3ded91af838f4376e4ad0781f0e971daf">97a6c6c3</a></strong>
<div>
<span> by Sylvain Henry </span> <i> at 2024-09-25T17:12:18-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>JS: fix h$withCStringOnHeap helper (#25288)
strlen returns the length of the string without the \0 terminating byte,
hence CString weren't properly allocated on the heap (ending \0 byte was
missing).
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/5f7c20bc6b9deacabb1fb099781f00371cdb4369">5f7c20bc</a></strong>
<div>
<span> by Ben Gamari </span> <i> at 2024-09-26T04:14:05-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>base: Propagate `error` CallStack to thrown exception
Previously `errorCallWithCallStackException` failed to propagate its
`CallStack` argument, which represents the call-chain of the preceding
`error` call, to the exception that it returned. Consequently, the
call-stack of `error` calls were quite useless.
Unfortunately, this is the second time that I have fixed this but it
seems the first must have been lost in rebasing.
Fixes a bug in the implementation of CLC proposal 164
<https://github.com/haskell/core-libraries-committee/issues/164>
Fixes #24807.
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c20d51867c824e32c61bd1e002680bef268e4f51">c20d5186</a></strong>
<div>
<span> by Matthew Pickering </span> <i> at 2024-09-26T04:14:42-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>driver: Fix -working-dir for foreign files
-working-dir definitely needs more serious testing, there are some easy
ways to test this.
* Modify Cabal to call ghc using -working-dir rather than changing
directory.
* Modify the testsuite to run ghc using `-working-dir` rather than
running GHC with cwd = temporary directory.
However this will have to wait until after 9.12.
Fixes #25150
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/88eaa7ac64fce8a33a6b7f35cbffdc4a0b5f6bed">88eaa7ac</a></strong>
<div>
<span> by Sylvain Henry </span> <i> at 2024-09-26T04:15:24-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Enum deriving: reuse predError, succError, toEnumError
Reuse predError, succError, and toEnumError when deriving Enum instances
to avoid generating different error strings per instance. E.g. before
this patch for every instance for a type FOO we would generate a string:
"pred{FOO}: tried to take `pred' of first tag in enumeration"#
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e9fa116326c56859e26c6a713788a756c1318cda">e9fa1163</a></strong>
<div>
<span> by Sylvain Henry </span> <i> at 2024-09-26T04:15:24-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Enum deriving: generate better code (#16364)
Generate better code for Enum.toEnum: check both the lower and the upper
bounds at once with an unsigned comparison.
Initially I've used a type ascription with a call to 'fromIntegral',
hence the slight refactoring of nlAscribe. Using 'fromIntegral' was
problematic (too low in the module hierarchy) so 'enumIntToWord' was
introduced instead.
Combined with the previous commit, T21839c ghc/alloc decrease by 5%
Metric Decrease:
T21839c
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/383af0743a46e0961c342261f13a4527ae838873">383af074</a></strong>
<div>
<span> by Sylvain Henry </span> <i> at 2024-09-26T04:16:06-04:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>Core: add absorb rules for binary or/and (#16351)
Rules:
x or (x and y) ==> x
x and (x or y) ==> x
</pre>
</li>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/51ef077ed8405971e5082d5a52c29f889e9dc9c4">51ef077e</a></strong>
<div>
<span> by Rodrigo Mesquita </span> <i> at 2024-09-26T13:32:47+01:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>determinism: Deterministic MonadGetUnique LlvmM
Update LlvmM to thread a unique deterministic supply (using UniqDSMT),
and use it in the MonadGetUnique instance.
This makes uniques sampled from LlvmM deterministic, which guarantees
object determinism with -fllvm.
Fixes #25274
</pre>
</li>
</ul>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
14 changed files:
</h4>
<ul>
<li class="file-stats">
<a href="#0887cf39c5cdf9cf8d6758f410d7dab3023c0d77">
compiler/GHC/Builtin/Names.hs
</a>
</li>
<li class="file-stats">
<a href="#02362b473a022fb921814e97a6beba08107d38b1">
compiler/GHC/Builtin/Types/Literals.hs
</a>
</li>
<li class="file-stats">
<a href="#1aff3a222f2ec5c5498930c3d145b401cc300028">
compiler/GHC/CmmToLlvm.hs
</a>
</li>
<li class="file-stats">
<a href="#b5ac041c7f79084a7a7626eda4cdadda3457d235">
compiler/GHC/CmmToLlvm/Base.hs
</a>
</li>
<li class="file-stats">
<a href="#783e5dae6e86931f06700fc088fb7d48c8a07386">
compiler/GHC/Core/Coercion.hs
</a>
</li>
<li class="file-stats">
<a href="#b0ab2032bd0c006bb9cda1e5433173de35930f53">
compiler/GHC/Core/Coercion.hs-boot
</a>
</li>
<li class="file-stats">
<a href="#f10ed7a2470454dfdd8691a08beba67d8b78ee70">
compiler/GHC/Core/Coercion/Axiom.hs
</a>
</li>
<li class="file-stats">
<a href="#975dc08a8e7942b32d621f617d5a9c1b668601dd">
compiler/GHC/Core/Coercion/Opt.hs
</a>
</li>
<li class="file-stats">
<a href="#6fcf64907fb5bdd93082d2d1eb94e4566e735865">
compiler/GHC/Core/DataCon.hs
</a>
</li>
<li class="file-stats">
<a href="#448d7f6e0151c2014de38dead3a902f511c45b75">
compiler/GHC/Core/FVs.hs
</a>
</li>
<li class="file-stats">
<a href="#91648438362e5a35363d2bb7abb04016dedd7d7e">
compiler/GHC/Core/FamInstEnv.hs
</a>
</li>
<li class="file-stats">
<a href="#36a42448a83a9d1f6df8475f03ead2eed199dd8e">
compiler/GHC/Core/Lint.hs
</a>
</li>
<li class="file-stats">
<a href="#aa79261abf782f3dc603af7fbd5c4b08ed3ddb88">
compiler/GHC/Core/Opt/ConstantFold.hs
</a>
</li>
<li class="file-stats">
<a href="#d01de95d8c71d4dec6a9a59146186e29a5b3fd38">
compiler/GHC/Core/Rules.hs
</a>
</li>
</ul>
<h5 style="margin-top: 10px; margin-bottom: 10px; font-size: .875rem;">
The diff was not included because it is too large.
</h5>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">
—
<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/165f0b4b9f8548d9cba99a8c8fd4bd70a36f178c...51ef077ed8405971e5082d5a52c29f889e9dc9c4">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.haskell.org">gitlab.haskell.org</a>. <a href="https://gitlab.haskell.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.haskell.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
</p>
</div>
</body>
</html>