Fix CODEOWNERS error, remove Lanza from ClangIR owners
The github project reports:
Unknown owner on line 39: make sure <name> exists and has write access to the repository
I assume Nathan's commit access lapsed and he has the `triage` role now.
I added a comment saying he is an emeritus owner. This is reversible,
and I assume if he needs or wants write access, we can revisit this in
the future.
[docs] Rename LangRef.{rst|md}
Tracking issue: #201242
This commit does not use valid markdown, so the docs will not build, but they will be fixed in an immediate follow-up commit that does the migration.
[Offload] Guard __llvm_write_custom_profile null check on non-Windows (#207170)
On Windows __llvm_write_custom_profile is defined as a strong stub (MSVC
lacks proper weak symbol support) by 09a51b2818e2, so its address is a
compile-time constant that is never null. The `if
(!__llvm_write_custom_profile)` check therefore triggers
-Wpointer-bool-conversion, which is fatal under -Werror.
Assisted-by: Claude
[Clang] Fix offsetof sign-extending unsigned array indices >= 128 (#204139)
When evaluating __builtin_offsetof with an unsigned integer array index
(e.g. uint8_t, uint16_t) whose value has the high bit set, Clang was
calling getSExtValue() on the APSInt index, which sign-extends the value
and produces a large bogus offset.
Fix this to use the correct kind of extension to extend smaller values, and to check for overflow in conversions of larger values.
Fixes #199319
AI Tool Use: GitHub Copilot (Claude Sonnet 4.6) was used to assist in
identifying the root cause of the bug in ExprConstant.cpp and drafting
the fix. The fix was reviewed, tested, and validated manually.
[BOLT] Stop materializing .dwo DIE vectors early in the pipeline
Summary: preprocessDWODebugInfo() eagerly force-extracted every .dwo
compile unit's DIE tree (getNonSkeletonUnitDIE(false)) very early in
BOLT pipeline, way before DWARFRewriter kicked in. Those vectors then
sit in memory throughout the entire rewrite pipeline, directly
contributing to BOLT's RSS peak. I did a fair amount of digging and
didn't find any reason as to why we need to keep all DIEs of DWO CU
materialized at all, since DWARFRewriter won't even read this vector
(the #197359 concurrency fix did use that, but that is unnecessary).
The problem is that these DIE trees are a massive contribution to RSS
when processing large binaries where we have 10s of K of dwos, storing
complete trees for each processed dwo.
This diff changes the #197359 concurrency fix to not rely on the DIE
sibling/children structure. It parses DWP type units selectively per
compile unit (DIEBuilder::buildDWPTypeUnitsForUnit ->
collectReferencedTypeSignatures) by finding the DW_FORM_ref_sig8
references in a unit's DIEs to decide which type units belong in that
[23 lines not shown]
jail: prevent a race between jail_attach in different threads
Attaching to a jail changes its root directory and its process
credentials. These operations both require unlocking the jail, and also
need allprison_lock unlocked. That means that if two threads are trying
to attach to different jails at the same time, it's possible for the
process to end up with one jail's root directory but the other jail's
credentials.
Solve this by forcing the process into single-threaded mode during
system calls that attach to a jail (jail_attach, jail_attach_jd, and
sometimes jail_set).
Reviewed by: kib, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D57858
[BOLT] Fix shifted DWARF inline-scope ranges; track scope boundaries
Summary:
BOLT updated DWARF lexical-scope ranges (DW_TAG_inlined_subroutine /
lexical_block low_pc/high_pc and DW_AT_ranges) via
translateInputToOutputRange(), which mapped a boundary using its input
offset relative to the start of the containing basic block:
OutAddr = BB.getOutputAddressRange().first + (InputOffset - BB.getOffset())
This assumes intra-block byte offsets are preserved input->output. Any
pass that changes instruction sizes within a block ahead of a scope
boundary breaks that assumption. With --plt=all, each `call foo at PLT`
(5 bytes, e8+rel32) is rewritten to `call *foo at GOT(%rip)` (6 bytes,
ff 15+rel32); N such calls before a boundary shift its emitted low_pc/
high_pc N bytes too early, onto the preceding instruction. The range
stays within the parent so `llvm-dwarfdump --verify` does not catch it;
symbolizers then attribute samples on those instructions to the wrong
inlined frames.
[43 lines not shown]
zstream: multithreading
This PR extends the `zstream_chain` mechanism introduced in #18509 to
include support for multithreading. It makes three main changes.
- It adds `zstream_queue.[ch]`, a generic FIFO queue with multiple
worker threads. This is a freestanding construct not directly tied to
ZFS or to the `zstream_chain` mechanism.
- It adapts `zstream_chain.[ch]` to allow both single-threaded and
multithreaded steps.
- It converts `zstream_fletcher4.[ch]` and `zstream_recompress.[ch]`
to use multithreading.
### Motivation
This patch significantly speeds recompression on modern CPUs. The
ultimate goal is to add a `zstream dedup` or `zstream pack` subcommand
[92 lines not shown]
Initial import of math/libpoly version 0.2.1.
SRI LibPoly is a C library for manipulating polynomials. The target
applications are symbolic reasoning engines, such as SMT solvers,
that need to reason about polynomial constraints. It is research
software under development, so the features and the API might change
rapidly.
[VPlan] Strip early-bail in noalias-check (#203936)
canHoistOrSinkWithNoAliasCheck currently bails eagerly when the
candidate memory location doesn't have a scope. This is unnecessary,
because the alias check automatically handles this: stripping this check
allows us to run the loop, which would never get to the alias check if
none of the recipes write to memory. The end result is that a read-only
FirstBB to LastBB ranges are determined not to alias with anything, even
if the scope metadata is absent, leading to licm-load-store
improvements.