[Git][ghc/ghc][wip/remove-unused-fields] 12 commits: iface: Store flags in interface files
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Mon Mar 10 13:17:06 UTC 2025
Matthew Pickering pushed to branch wip/remove-unused-fields at Glasgow Haskell Compiler / GHC
Commits:
44bf5fa1 by Matthew Pickering at 2025-03-07T13:48:18+00:00
iface: Store flags in interface files
When reporting the reason why a module is recompiled (using
`-dump-hi-diffs`), it is much more informative to inform the user about
which flag exactly has changed, rather than just an opaque reference to
a hash.
Now, when the user enables `-fwrite-if-self-recomp-flags`
there is a difference the precise part of the flags is
reported:
```
codegen flags changed:
before: [Opt_NoTypeableBinds, Opt_OmitYields]
after: [Opt_NoTypeableBinds, Opt_OmitYields, Opt_DictsStrict]
```
Fixes #25571
- - - - -
324222bd by Oleg Grenrus at 2025-03-08T08:50:18-05:00
Run fix-whitespace on compiler/
https://hackage.haskell.org/package/fix-whitespace
IMO this should be included into lint suite
- - - - -
1e53277a by sheaf at 2025-03-08T16:32:25-05:00
Allow defaulting of representational equalities
This commit generalises the defaulting of equality constraints that
was introduced in 663daf8d (with follow-up in 6863503c) to allow
the defaulting of *representational* equality constraints.
Now we default a representational equality
ty1 ~R# ty2
by unifying ty1 ~# ty2.
This allows the following defaulting to take place:
- Coercible alpha[tau] Int ==> alpha := Int
- Coercible (IO beta[tau]) (IO Char) ==> beta := Char
See Note [Defaulting representational equalities] in GHC.Tc.Solver.Default
for more details.
Fixes #21003
- - - - -
d6c40afc by Andreas Klebinger at 2025-03-08T16:33:02-05:00
Revert "Use `Infinite` in unique generation, and clean up some other partial uni patterns as well."
This reverts commit 643dd3d86968c527ba07ece9cc337728dbdfe2a0.
As described in #25817 this commit introduced a subtle bug in AArch64
code generation. So for the time being I will simply revert it
wholesale.
- - - - -
68310e11 by Andreas Klebinger at 2025-03-08T16:33:39-05:00
Properly describe acceptance window for stat tests.
The relative metric is already in %, so no need to multiply by 100.
- - - - -
cca68421 by Cheng Shao at 2025-03-08T22:04:42-05:00
wasm: do not use wasm type reflection in dyld
The wasm dynamic linker used to depend on v8's experimental wasm type
reflection support to generate stub functions when treating GOT.func
items that aren't exported by any loaded library yet. However, as we
work towards wasm ghci browser mode (#25399), we need to ensure the
wasm dyld logic is portable across browsers. So this commit removes
the usage of wasm type reflection in wasm dyld, and it shall only be
added many months later when this feature is widely available in
browsers.
- - - - -
75fcc5c9 by Cheng Shao at 2025-03-08T22:05:19-05:00
wasm: don't create a wasm global for dyld poison
There's a much more efficient way to convert an unsigned i32 to a
signed one. Thanks, o3-mini-high.
- - - - -
fd40eaa1 by Cheng Shao at 2025-03-08T22:05:19-05:00
wasm: revamp JSFFI internal implementation and documentation
This patch revamps the wasm backend's JSFFI internal implementation
and documentation:
- `JSValManager` logic to allocate a key is simplified to simple
bumping. According to experiments with all major browsers, the
internal `Map` would overflow the heap much earlier before we really
exhaust the 32-bit key space, so there's no point in the extra
complexity.
- `freeJSVal` is now idempotent and safe to call more than once. This
is achieved by attaching the `StablePtr#` to the `JSVal#` closure
and nullifying it when calling `freeJSVal`, so the same stable
pointer cannot be double freed.
- `mkWeakJSVal` no longer exposes the internal `Weak#` pointer and
always creates a new `Weak#` on the fly. Otherwise by finalizing
that `Weak#`, user could accidentally drop the `JSVal`, but
`mkWeakJSVal` is only supposed to create a `Weak` that observes the
`JSVal`'s liveliness without actually interfering it.
- `PromisePendingException` is no longer exported since it's never
meant to be caught by user code; it's a severe bug if it's actually
raised at runtime.
- Everything exported by user-facing `GHC.Wasm.Prim` now has proper
haddock documentation.
- Note [JSVal representation for wasm] has been updated to reflect the
new JSVal# memory layout.
- - - - -
9baaabb9 by Matthew Pickering at 2025-03-10T13:05:18+00:00
Take into account all flags when computing iface_hash
The "interface hash" should contain a hash of everything in the
interface file. We are not doing that yet but at least a start is to
include a hash of everything in `mi_self_recomp`, rather than just
`mi_src_hash` and `mi_usages`.
In particular, this fixes #25837, a bug where we should recompile a
`dyn_hi` file but fail to do so.
- - - - -
bb2dfa55 by Matthew Pickering at 2025-03-10T13:15:24+00:00
Pass -fPIC to dynamicToo001 test to avoid platform dependence issues
On darwin platforms, `-fPIC` is always enabled but on linux it is only
enabled in the dynamic flavour. This can cause a difference in
interface files (see #25836).
The purpose of this test isn't to test module A recompilation, so we
avoid this platform dependency by always passing `-fPIC`.
- - - - -
5a2404b8 by Matthew Pickering at 2025-03-10T13:15:24+00:00
Remove mi_used_th field from interface files
In the distant past, recompilation checking was disabled for interfaces which used
TemplateHaskell, but for several years now recompilation checking has
been more fine-grained. This has rendered this field unused and
lingering in an interface file.
- - - - -
90d69296 by Matthew Pickering at 2025-03-10T13:15:24+00:00
Remove mi_hpc field from interface files
The `mi_hpc` field is not used for anything as far as I can discern so
there is no reason to record in the private interface of a module that
there are modules in the transitive closure which use `hpc`.
You can freely mix modules which use `-fhpc` and ones which don't.
Whether to recompile a module due to `-fhpc` being passed to the module
itself is determined in `fingerprintDynFlags`.
- - - - -
91 changed files:
- compiler/GHC.hs
- compiler/GHC/Cmm/CallConv.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
- compiler/GHC/CmmToAsm/X86/RegInfo.hs
- compiler/GHC/Core/LateCC/TopLevelBinds.hs
- compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Data/Graph/Color.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- + compiler/GHC/Driver/IncludeSpecs.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Specificity.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/Iface/Env.hs
- + compiler/GHC/Iface/Flags.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Recomp/Flags.hs
- compiler/GHC/Iface/Recomp/Types.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/JS/Opt/Expr.hs
- compiler/GHC/JS/Opt/Simple.hs
- compiler/GHC/Platform/LoongArch64.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Stg/Unarise.hs
- compiler/GHC/StgToCmm/TagCheck.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Hole/Plugin.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/TcRef.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Types/HpcInfo.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/PkgQual.hs
- compiler/GHC/Types/ProfAuto.hs
- compiler/GHC/Types/SafeHaskell.hs
- compiler/GHC/Types/SptEntry.hs
- compiler/GHC/Types/Unique/Supply.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Utils/Unique.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.14.1-notes.rst
- docs/users_guide/phases.rst
- docs/users_guide/wasm.rst
- libraries/ghc-experimental/src/GHC/Wasm/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Flag.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs
- rts/wasm/JSFFI.c
- rts/wasm/jsval.cmm
- testsuite/driver/perf_notes.py
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/default/default-fail08.hs
- testsuite/tests/default/default-fail08.stderr
- testsuite/tests/driver/dynamicToo/dynamicToo001/Makefile
- + testsuite/tests/driver/dynamicToo/dynamicToo001/T25837.stdout
- + testsuite/tests/driver/dynamicToo/dynamicToo001/T25837Module.hs
- testsuite/tests/driver/dynamicToo/dynamicToo001/test.T
- testsuite/tests/jsffi/jsffigc.hs
- testsuite/tests/rep-poly/T14561b.stderr
- testsuite/tests/rep-poly/UnliftedNewtypesCoerceFail.stderr
- + testsuite/tests/typecheck/should_compile/T21003.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T10495.hs
- testsuite/tests/typecheck/should_fail/T10495.stderr
- utils/jsffi/dyld.mjs
- utils/jsffi/prelude.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6ad1f029e3fcc7c5a493cbb5273d86d3b1d1c362...90d69296c0cf9ffeac6c0dadef287aa75c6119ce
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6ad1f029e3fcc7c5a493cbb5273d86d3b1d1c362...90d69296c0cf9ffeac6c0dadef287aa75c6119ce
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/20250310/909565ed/attachment-0001.html>
More information about the ghc-commits
mailing list