[Git][ghc/ghc][wip/andreask/9.10-backports] 23 commits: AArch64: Simplify BL instruction

Andreas Klebinger (@AndreasK) gitlab at gitlab.haskell.org
Tue Jan 28 14:39:10 UTC 2025



Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC


Commits:
786303f5 by Sven Tennie at 2025-01-28T15:07:02+01:00
AArch64: Simplify BL instruction

The BL constructor carried unused data in its third argument.

(cherry picked from commit eb612fbc8e94d50c9895c02f3d6ee076f61b7773)

- - - - -
b8cb2249 by Sven Tennie at 2025-01-28T15:07:02+01:00
AArch64: Implement switch/jump tables (#19912)

This improves the performance of Cmm switch statements (compared to a
chain of if statements.)

(cherry picked from commit 1d22611665117131d1c7c3c0287696e8efcc88f2)

- - - - -
4621dab0 by Andrzej Rybczak at 2025-01-28T15:07:02+01:00
Fix typo in the @since annotation of annotateIO

(cherry picked from commit 55609880c3eeda2c13859c10c157d7df05496288)

- - - - -
397b2a2a by Cristiano Moraes at 2025-01-28T15:07:02+01:00
configure: Find C++ probing when GCC version is the latest but G++ is old #23118

(cherry picked from commit 78ad81ecef846f73fee0f6c1a86cd6f19aa29b21)

- - - - -
cf2b4a95 by sheaf at 2025-01-28T15:07:02+01:00
LLVM: use sse4.2 instead of sse42

LLVM expects the former instead of the latter since version 3.4.

Fixes #25019

(cherry picked from commit 694489edf35c35b29fbdf09a8e3fdc404469858f)

- - - - -
501b0335 by sheaf at 2025-01-28T15:07:02+01:00
LLVM: make SSE4.2 imply +popcnt

For consistency with the NCG as well as with Clang and GCC, we make
the SSE4.2 feature flag imply +popcnt when using the LLVM backend.

Fixes #25353

(cherry picked from commit 06ae85071b95376bd1eb354f7cc7901aed45b625)

- - - - -
b4a4848f by Ben Gamari at 2025-01-28T15:07:02+01:00
testsuite: Normalise trailing digits from hole fits output

The type variables in the holes fit output from
`abstract_refinement_hole_fits` is quite sensitive to compiler
configuration. Specifically, a slight change in the inlining
behavior of `throw` changes type variable naming in `(>>=)` and a few
others.

Ideally we would make hole fits output more deterministic but in the
meantime we simply normalise this difference away as it not relevant
to the test's goal.

(cherry picked from commit d029f1700effa626ff622700b198ed49ee8b6c19)

- - - - -
3af5c6c1 by Ben Gamari at 2025-01-28T15:07:02+01:00
base: Add test for #25066

(cherry picked from commit da5d7d0d8bde06a1c29612fd17b6a579fc523036)

- - - - -
7569f321 by Ben Gamari at 2025-01-28T15:07:02+01:00
base: Fix #25066

As noted in #25066, the exception backtrace proposal introduced a rather
subtle performance regression due to simplification producing Core which
the demand analyser concludes may diverge with a precise exception. The
nature of the problem is more completely described in the new Note
[Hiding precise exception signature in throw].

The (rather hacky) solution we use here hides the problematic
optimisation through judicious use of `noinline`. Ultimately however we
will want a more principled solution (e.g. #23847).

Fixes #255066

CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290

Metric Decrease:
    T9872d

(cherry picked from commit eb7ddae1a2b3fb1be1cd635849516a6398327b29)

- - - - -
0dc9b9d9 by Ben Gamari at 2025-01-28T15:07:02+01:00
base: Improve documentation of Control.Exception.Backtrace

(cherry picked from commit 0060ece762d7a936daf28195676b6162c30dc845)

- - - - -
58447b1b by Andreas Klebinger at 2025-01-28T15:07:02+01:00
9.10.2 - more changelogs

- - - - -
6dd945b9 by Cheng Shao at 2025-01-28T15:07:02+01:00
Revert "compiler: start deprecating cmmToRawCmmHook"

This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns
out the GHC-WPC project does use it to observe Cmm in the pipeline,
see #25363.

(cherry picked from commit 525d451e175c7d6acfa968ce99d8d3fc7a8af0c7)

- - - - -
ba420fdd by Cheng Shao at 2025-01-28T15:07:02+01:00
rts: fix pointer overflow undefined behavior in bytecode interpreter

This patch fixes an unnoticed undefined behavior in the bytecode
interpreter. It can be caught by building `rts/Interpreter.c` with
`-fsanitize=pointer-overflow`, the warning message is something like:

```
rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13
rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13
rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13
```

Whenever we do something like `SpW(-1)`, the negative argument is
implicitly converted to an unsigned integer type and causes pointer
arithmetic overflow. It happens to be harmless for most targets since
overflowing would wrap the result to desired value, but it's still
coincidental and undefined behavior. Furthermore, it causes real
damage to the wasm backend, given clang-20 will emit invalid wasm code
that crashes at run-time for this kind of C code! (see
https://github.com/llvm/llvm-project/issues/108770)

The fix here is adding some explicit casts to ensure we always use the
signed `ptrdiff_t` type as right hand operand of pointer arithmetic.

(cherry picked from commit 5bcfefd5bb73c18a9bad63d1813968832b696f9a)

- - - - -
47977ab7 by Zubin Duggal at 2025-01-28T15:07:02+01:00
rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names

(cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45)
(cherry picked from commit 280b627869da55a22b4b9a3458e6115b06b5fff4)

- - - - -
9acb4a30 by Zubin Duggal at 2025-01-28T15:07:02+01:00
release: copy zip files into the correct directory

Fixes #25446

(cherry picked from commit 346e4cd1903b2cbcc9bb7c39652666c513eb2a59)

- - - - -
3a076771 by Zubin Duggal at 2025-01-28T15:07:02+01:00
release: Sign .gz bindists too

Fixes #25447

(cherry picked from commit bbdbe2254df1bfc9157cfb409afc93f8157712cd)

- - - - -
9a49df8d by Sebastian Graf at 2025-01-28T15:07:02+01:00
DmdAnal: Make `prompt#` lazy (#25439)

This applies the same treatment to `prompt#` as for `catch#`.
See `Note [Strictness for mask/unmask/catch/prompt]`.

Fixes #25439.

(cherry picked from commit 00d58ae18a7ce8db6b2d57261a08ba8c1c2549b5)

- - - - -
3724a021 by Andreas Klebinger at 2025-01-28T15:07:02+01:00
Compacting GC: Handle black holes in large objects.

As #14497 showed black holes can appear inside large objects when
we capture a computation and later blackhole it like we do for AP_STACK
closures.

Fixes #24791

(cherry picked from commit 7f90f319531c312a074d21688b05f664f0d173fc)

- - - - -
660ad907 by Ben Gamari at 2025-01-28T15:07:02+01:00
rts: Allow ExecPage to allocate anywhere in address space

Currently the ExecPage facility has two users:

 * GHCi, for constructing info tables, and
 * the adjustor allocation path

Despite neither of these have any spatial locality constraints ExecPage
was using the linker's `mmapAnonForLinker`, which tries hard to ensure
that mappings end up nearby the executable image. This makes adjustor
allocation needlessly subject to fragmentation concerns.

We now instead return less constrained mappings, improving the
robustness of the mechanism.

Addresses #25503.

(cherry picked from commit a104508d2ea5bbc61c4a756dca42fc043b329709)

- - - - -
8cb92d62 by Ben Gamari at 2025-01-28T15:07:02+01:00
base: Fix incorrect mentions of GHC.Internal.Numeric

These were incorrectly changed by the automated refactoring of the
`ghc-internal` migration.

Fixes #25521.

(cherry picked from commit c3fc9b861fd00a85a4fcbd9960b8242d9fabe04b)

- - - - -
2e3ce607 by Arnaud Spiwack at 2025-01-28T15:07:02+01:00
Add test for #25428

(cherry picked from commit e6c957e49260230c4cb297aeec16be3293381fb7)

- - - - -
290fe2f2 by Rodrigo Mesquita at 2025-01-28T15:10:44+01:00
ghc-internal: Derive version from ghc's version

Fixes #25005

This also introduces ghc-experimental.cabal.in

(cherry picked from commit 05116c83ec0d74bc66fa50181df8f577a09f24a6)

- - - - -
cc7a06ae by Andreas Klebinger at 2025-01-28T15:11:42+01:00
Change versionig of ghc-experimental to follow ghc versions.

Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning.
This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on.

This fixes #25289

(cherry picked from commit 2293c0b7d709df7be04f596e72c97fd2435c4134)

- - - - -


30 changed files:

- .gitignore
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- .gitlab/rel_eng/recompress-all
- .gitlab/rel_eng/upload.sh
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- docs/users_guide/9.10.2-notes.rst
- hadrian/cfg/system.config.in
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- libraries/base/base.cabal → libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Control/Exception/Backtrace.hs
- libraries/base/src/Data/Char.hs
- libraries/base/src/Data/Semigroup.hs
- libraries/base/src/Prelude.hs
- + libraries/base/tests/T25066.hs
- + libraries/base/tests/T25066.stderr
- libraries/base/tests/all.T
- libraries/ghc-experimental/ghc-experimental.cabal → libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-heap/ghc-heap.cabal.in
- libraries/ghc-internal/ghc-internal.cabal → libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Base.hs
- libraries/ghc-internal/src/GHC/Internal/Exception.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d7d9aa07406a69daffeeedca3bb20969ba0b383e...cc7a06ae7b433a58b4d395fde442e3a5304f71c4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d7d9aa07406a69daffeeedca3bb20969ba0b383e...cc7a06ae7b433a58b4d395fde442e3a5304f71c4
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/20250128/f608b7d3/attachment-0001.html>


More information about the ghc-commits mailing list