[docs] Finish MyST migration for remaining Clang docs (#220381)
This migrates all remaining clang/docs/**rst files to markdown. There
are still 2-3 remaining generated rst files, and I'm working on that
next. The pixel diff shows 0.4045% pixel differences after
longest-common-subsequence vertical alignment, and they all looked
intentional to me. I don't have a good process for serving that HTML, or
I'd share it.
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is a stacked PR based on #220380, which will be a standalone commit
that
renames *.rst -> *.md before this PR lands for history preservation
purposes.
This was prepared with rst2myst plus LLM-assisted cleanup.
[docs] Rename remaining Clang docs for MyST migration (#220380)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the initial straight rename commit. It will probably break the
docs build, but it has to be a separate PR for blame preservation
purposes.
[AMDGPU][SIInsertWaitcnts] Fix soft wait removal with loop-carried deps
The code that checked if a soft waitcnt (such as the one insterted by
a release fence on LDS) was redundant didn't correctly account for the
fact that that, for example, the previous iteration of a loop could
have introduced memory traffic that needs to be waited on. This bug
appeared to be fairly rare in practice (probably due to the
instruction scheduler shuffling around code in t bad form) but it can
happen.
The fix is that, instad of immediately erasing "redundant" waits, we
add them to a set of waits to be erased, and then remove them from the
set if they prove to be truly redundant.
This has the side effect of fixing a correctness issue around the CAS
loops we emit on gfx1250 - the global_inv we emit after the
`s_loadcnt 0x0` is itself a `loadcnt`-able event, and so needs to be
forced to completion before the next iteration of the CAS loop.
[5 lines not shown]
[AMDGPU] Pre-commit tests for loop-carried memory waits (#220356)
SIInsertWaitcnts is currently dropping waits in a
(fence; read; write; branch) loop in some cases. Pre-commit tests to
show the problem.
AI disclosure: test generated by AI, but I poked them into not being
terrible.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
[IR] `replaceUsesWith` when aliasing a GV and the use is `dso_local_equivalent` (#220336)
When we want to replace all uses of a GlobalValue `GV` with an alias to
it, the replacing should keep `dso_local_equivalent` semantics - i.e.
such use will be to a `dso_local_equivalent` of the alias of the GV.
Fixes an issue discovered during a certain configuration of chrome
builds, see https://issues.chromium.org/issues/552515375
[lld][MachO] Support Objective-C class stubs
Teach Mach-O objc stubs to synthesize class-message stubs that load the class object, selector, and objc_msgSend target.
lld already supports the Apple clang _objc_msgSend$<selector> stub form, even though upstream clang does not currently expose a driver or cc1 flag for emitting it. Apple clang also emits _objc_msgSendClass$<selector>$_OBJC_CLASS_$_<class>; handling that form completes the existing selector-stub support.
Cover local classes, dylib classes, archives, dynamic lookup via -U, missing class symbols, malformed names, unsupported architectures, and dead stripping.
[mlir][ODS] Populate properties in legacy aggregate builders (#219194)
Partition mixed aggregate attributes before operation creation and
deprecate the generated compatibility overloads for operations with
non-empty properties.
This is part of a general migration to use the "new" properties-based
APIs #155475
Assisted-by: Codex
[lld][MachO] Fix ObjC stubs from autolinked archives
Move ObjC stub preparation after LC_LINKER_OPTION processing so archive members loaded via autolink can contribute _objc_msgSend$ selector stubs before selector references are built.
Previously those stubs missed __objc_methname setup; assert builds could fail in makeSelRef, and release builds could form an invalid selector reference.
[lld][MachO] Prepare ObjC stubs for variable sizes
Track ObjC stub sizes explicitly so future changes can mix different stub layouts in one synthetic section.
graphics/openxr: Fix build after update jsoncpp, improve port
After add devel/jsoncpp/patch-jsoncpp-namespaced-targets.cmake in
9d1b7732976723160adfd2c6c4240e34555ac30c graphics/openxr fails to build
with error:
ninja: error: 'jsoncpp_lib-NOTFOUND', needed by 'src/loader/libopenxr_loader.so', missing and no known rule to make it
- Switch to use shared library jsoncpp instead of static.
- Update compiler requirements in USES.
- Ensure that tests aren't picked up in some weird way (not included in
repo).
PR: 298099
Sponsored by: UNIS Labs
Co-authored-by: Vladimir Druzenko <vvd at FreeBSD.org>
[mlir][xegpu] Resolve scf.while "after" region argument layouts (#220094)
This PR handles the layout conflict resolution and argument layout
access for scf.while. It limited the scf.while to pass-through use case:
when `scf.condition` forwards a "before" argument unchanged, the "after"
argument's layout can be accessed as scf.while's expected operand layout
for the init operands. In this way, the handling of scf.for is unified
with scf.while, the argument layout can be derived by the loop op's
operand's layout.
assited-by-claude
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
[BOLT] Preserve dynamic relocations for LSDA type tables
An LSDA type table entry can be supplied by a dynamic relocation instead of
being resolved at static link time -- for example a DW_EH_PE_absptr entry
naming a typeinfo from a shared library, in a binary linked with -z notext.
Such an entry is zero in the file and filled in by the loader at startup.
BOLT re-emitted .gcc_except_table with those entries as plain integers and
left the relocations pointing at the original section. At run time the loader
then populated .bolt.org.gcc_except_table, which nothing reads, while the live
table stayed zero. __gxx_personality_v0 treats a null type table entry as a
catch-all, so the first catch clause of the function silently swallowed every
exception -- e.g. a std::invalid_argument caught by catch (std::bad_alloc &).
Record such relocations while parsing the LSDA, label the corresponding entries
of the re-emitted table, and move the relocations onto them once the output
addresses are known.
The relocations are moved rather than added, because .rela.dyn is rewritten in
[6 lines not shown]
Fix bond transmit hash policy never reaching the kernel
## Problem
The stored hash policy string was translated into the `truenas_pynetif` enum by member-name lookup. The stored values are `layer2`, `layer2+3` and `layer3+4`, while the enum members are `LAYER2`, `LAYER23` and `LAYER34` — `+` cannot appear in a Python identifier, so two of the three resolved to `None`, and `getattr`'s default swallowed the miss with no log or exception. The netlink attribute was then never packed and the kernel silently kept its default `layer2`, so outbound traffic could not spread across bond members. Every LACP/LOADBALANCE bond defaults to `layer2+3`, so this was not limited to people who picked a policy explicitly. `lacpdu_rate` goes through the identical construct and only works because `SLOW` and `FAST` happen to be valid identifiers.
## Solution
Map the choice enums to library members explicitly, behind two helpers that take the stored string and return an enum or `None`. Dict literals rather than a name lookup, so a rename on the library side becomes a static attribute error at import time instead of another silent `None`.
The call sites log the offending value and carry on rather than raising: `configure_bonds_impl` swallows per-bond exceptions, so raising here would abandon the bond before its members are enslaved and its MTU is set, turning a degraded network into an absent one on the boot path.
The helpers are pure — no context, no socket — which is what makes the mapping testable without a scaffold of mocks. The test pins the kernel integers literally, since `LAYER23` is 2 and `LAYER34` is 1 and that ordering is easy to get backwards.
[lld][MachO] Support Objective-C class stubs
Teach Mach-O objc stubs to synthesize class-message stubs that load the class object, selector, and objc_msgSend target.
lld already supports the Apple clang _objc_msgSend$<selector> stub form, even though upstream clang does not currently expose a driver or cc1 flag for emitting it. Apple clang also emits _objc_msgSendClass$<selector>$_OBJC_CLASS_$_<class>; handling that form completes the existing selector-stub support.
Cover local classes, dylib classes, archives, dynamic lookup via -U, missing class symbols, malformed names, unsupported architectures, and dead stripping.
[lld][MachO] Fix ObjC stubs from autolinked archives
Move ObjC stub preparation after LC_LINKER_OPTION processing so archive members loaded via autolink can contribute _objc_msgSend$ selector stubs before selector references are built.
Previously those stubs missed __objc_methname setup; assert builds could fail in makeSelRef, and release builds could form an invalid selector reference.
[lld][MachO] Prepare ObjC stubs for variable sizes
Track ObjC stub sizes explicitly so future changes can mix different stub layouts in one synthetic section.
[SandboxVec][Scheduler][NFC] Assert scheduling direction (#219544)
This patch implements a check that will cause a crash if we attempt to
schedule in the direction opposite to the one set when initializing the
scheduler. Crashing early with a helpful error message is better than
what we currently do, which is silently accepting the scheduling attempt
which may not even cause an immediate crash but could cause a crash
sometime later, providing few clues about what went wrong.
The vectorizer won't exercise switching directions, so this is tested
with unittests.