Repository navigation
Cmm: declare CPU requirements on RTS procedures - #197
Merged
Merged
Conversation
angerman
added a commit
that referenced
this pull request
Oct 15, 2026
Backport GHC !16687 (9020062), retaining build-time generation and existing RTS ownership of apply/Jumps routines. Carry procedure attributes through Cmm lowering, splitting and native/LLVM code generation, and remove the per-file vector ISA build rules. Adapt native feature handling to stable, preserve target-default and global LLVM features with ordered overrides, and honor LLVM-version feature gates. Keep scalar/V16 procedures at baseline and reject unsupported attributes. Add native isolation, rejection and LLVM feature-list regressions. Check the LLVM API independently of external LLVM tools. Preserve the portability branch's PIC trampoline/CFG fixes when adapting raw procedure metadata.
angerman
force-pushed
the
review/pr194-clean
branch
from
October 15, 2026 11:50
c6a8066 to
5e64db5
Compare
angerman
marked this pull request as ready for review
October 15, 2026 13:02
angerman
added a commit
that referenced
this pull request
Oct 15, 2026
Backport GHC !16687 (9020062), retaining build-time generation and existing RTS ownership of apply/Jumps routines. Carry procedure attributes through Cmm lowering, splitting and native/LLVM code generation, and remove the per-file vector ISA build rules. Adapt native feature handling to stable, preserve target-default and global LLVM features with ordered overrides, and honor LLVM-version feature gates. Keep scalar/V16 procedures at baseline and reject unsupported attributes. Add native isolation, rejection and LLVM feature-list regressions. Check the LLVM API independently of external LLVM tools. Preserve the portability branch's PIC trampoline/CFG fixes when adapting raw procedure metadata.
angerman
force-pushed
the
review/pr194-clean
branch
from
October 15, 2026 23:38
5e64db5 to
f295627
Compare
angerman
added a commit
that referenced
this pull request
Oct 16, 2026
Backport GHC !16687 (9020062), retaining build-time generation and existing RTS ownership of apply/Jumps routines. Carry procedure attributes through Cmm lowering, splitting and native/LLVM code generation, and remove the per-file vector ISA build rules. Adapt native feature handling to stable, preserve target-default and global LLVM features with ordered overrides, and honor LLVM-version feature gates. Keep scalar/V16 procedures at baseline and reject unsupported attributes. Add native isolation, rejection and LLVM feature-list regressions. Check the LLVM API independently of external LLVM tools. Preserve the portability branch's PIC trampoline/CFG fixes when adapting raw procedure metadata.
angerman
force-pushed
the
review/pr194-clean
branch
from
October 16, 2026 04:14
f295627 to
20c3c72
Compare
Restore profiling library suffixes, export the Emscripten heap views, and apply vector ISA flags consistently on both x86 widths. Keep PIC jump-table shortcuts within their procedure and preserve the required trampolines. Handle Android target names, ELF visibility fallbacks and supported local GOT definitions. Preserve BFD import types and nullable lookup outputs. Trim Apple ranlib padding from wasm archive members with bounded decoding. Add focused regressions, including assembler-independent local GOT and GNU BFD fixtures. Repair Windows, FreeBSD, Debian and macOS CI prerequisites, provide pinned native Alex/Happy for stage3, and wire Make test capabilities. Qualify the BFD regression archive path to locate its adjacent DLL. Filter only complete Apple ranlib warnings about empty archive members, preserving other diagnostics and exit failures without Apple-only command-line flags. Handle PATH launchers whose diagnostics name a resolved absolute ranlib path, and cover both qualified and PATH invocations in the regression.
Backport GHC !16687 (9020062), retaining build-time generation and existing RTS ownership of apply/Jumps routines. Carry procedure attributes through Cmm lowering, splitting and native/LLVM code generation, and remove the per-file vector ISA build rules. Adapt native feature handling to stable, preserve target-default and global LLVM features with ordered overrides, and honor LLVM-version feature gates. Keep scalar/V16 procedures at baseline and reject unsupported attributes. Add native isolation, rejection and LLVM feature-list regressions. Check the LLVM API independently of external LLVM tools. Preserve the portability branch's PIC trampoline/CFG fixes when adapting raw procedure metadata.
angerman
force-pushed
the
review/pr194-clean
branch
from
October 16, 2026 11:46
20c3c72 to
0aaa5fa
Compare
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #196; supersedes #194. Backports GHC !16687 with stable-branch corrections and stronger regressions.
RTS vector procedures need AVX2/AVX-512 while scalar and V16 procedures must retain the baseline instruction set. Instead of matching source filenames in Cabal/Hadrian, procedures now declare their requirements with Cmm
__attribute__((target("avx2")))attributes. Apply/Jumps routines remain generated and compiled into the RTS at build time, preserving the existing linking arrangement.Implementation and corrections
The attribute is additive; global RTS flags must still avoid enabling AVX for baseline procedures. It does not add runtime CPU dispatch.
Validation
The clean history is
93c3dc1716 → 09f5c34611 → 0aae70d65d (#196) → 0aaa5fa085 (#197). The feature patch is unchanged by this restacking; it now includes #196's reviewed Windows-fixture, ranlib (including resolved PATH-launcher diagnostics) and pinned-mirror bootstrap corrections. CI has restarted on both exact heads. Fast-forward only after the current candidates are green. The abandoned link-time implementation is absent.5e64db50c7passed normal CI and Nix CI: all four normal suites, six Nix native suites, three MULTI cross builds and three strict artifact-consuming e2e jobs. Linux JUnits explicitly confirm the Cmm attribute, isolation/rejection and LLVM API regressions. The e2e jobs cover native/Wasm/JS hello execution and the Miso Wasm build. These are prior-head results; current CI must pass again.5fa0da603b/f2956276fe. The shared external Wasm bootstrap failures are repaired with a pinned, checksum-verified official mirror archive, retaining full upstream setup; focused failure-path and real Darwin SDK/libffi probes pass, and Astra cleared the repair. Complete setup and consumers still require new-head CI.static001remains current CI qualification.T26537with-O2 -fregs-graph. A focused same-runner comparison passed the original Fix compiler and RTS portability issues exposed by haskell.nix #196 and Cmm: declare CPU requirements on RTS procedures #197 compilers in 497s and 402s with unchanged flags, outputs and 1,500-second limits. The timeout did not reproduce; one ordered pair establishes no general speedup or flakiness classification. A subsequent ARM dynamic suite timed out in the same test, while its static counterpart passed; current full platform suites remain required.LLVM API execution is distinct from LLVM Cmm emission; actual LLVM emission was exercised locally with external LLVM tools. No timeout, assertion or expected result has been relaxed.
A previous Ubuntu 24 runtime suite (
20c3c72df9) reported oneT21651(threaded1)segmentation fault; the same test passed both normal Linux configurations. Its targeted retry is retained without changing assertions or classifying the crash. Current candidate platform suites must pass.