[Hexagon] Skip CRT start files for relocatable (-r) links on musl (#201262)
Guard the dynamic-linker, crt1.o, and crti.o additions with OPT_r,
consistent with Gnu.cpp and the existing -pie suppression in this file.
CRT start files must not appear in partial links (-r) as they define
_start, causing duplicate-symbol errors when the output is later linked
into an executable.
[ACCRecipeMaterialization] add tests for private/firstprivate destroy (#203990)
While working on #203935, I noticed that private and firstprivate
recipes with destroy regions were not tested. Add these tests and fix a
bug from the previous commit that would have been caught had these tests
been fixed by generating the destroy region at the correct insertion
point
[AArch64] Add scalable i128 costmodel test coverage. NFC (#203996)
This also adds some basic sub costs, similar to the others, and sorts
the
operations into a more standard order.
[SLP] Fix insert point for insertvalue buildvector with copyable operands
Use the last insertvalue as the insert point (like insertelement) so the
vec2struct store/load are not emitted before the vectorized operand.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/203994
[docs] Enforce unambiguous toctree in llvm/docs
It seems like using a non-`hidden` `toctree` for page navigation is a
bit of a trap, in that every doc must have a single unique path through
the global toctree to the root doc, and it is very easy to end up with
multiple.
This patch tries to address the warnings (actually infos, hence why it
does not fail the build) in llvm/docs/, namely:
$ sphinx-build -b html -jauto llvm/docs/ /tmp/sphinx-out
checking consistency...
llvm/docs/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack.md: document is referenced in multiple toctrees: ['UserGuides', 'AMDGPUUsage'], selecting: UserGuides <- AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack
llvm/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst: document is referenced in multiple toctrees: ['UserGuides', 'AMDGPUUsage'], selecting: UserGuides <- AMDGPUDwarfExtensionsForHeterogeneousDebugging
llvm/docs/CommandGuide/llvm-reduce.rst: document is referenced in multiple toctrees: ['CommandGuide/index', 'CommandGuide/index', 'Reference'], selecting: Reference <- CommandGuide/llvm-reduce
llvm/docs/GitHub.rst: document is referenced in multiple toctrees: ['GettingInvolved', 'UserGuides'], selecting: UserGuides <- GitHub
llvm/docs/GlobalISel/IRTranslator.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/IRTranslator
llvm/docs/GlobalISel/InstructionSelect.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/InstructionSelect
llvm/docs/GlobalISel/Legalizer.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/Legalizer
[35 lines not shown]
[docs] Create utils/docs
llvm-project is home to many sphinx documentation sites, each with
configuration quirks and bespoke extentions.
The sphinx config model makes sharing code somewhat difficult. There
are options like sphinx-multiproject, but some of our docs builds are
out of the source tree while some are done out of the binary tree, so
the multiproject configuration itself would need to be generated. It
also would impose more uniformity around extensions than required.
This change instead creates a python package at utils/docs/llvm_sphinx
and makes it available to all sphinx-build processes via PYTHONPATH.
Each conf.py does not modify its own sys.path because not all builds are
out of the source tree, so there isn't a stable relative path to use to
refer to the utils/docs/ directory.
Type checking via pyright in new package is pinned to being python 3.8
compatible.
[29 lines not shown]
[CIR] Fix bitfield post-increment return value (#201723)
In \`emitScalarPrePostIncDec\`, the bitfield branch called
\`emitStoreThroughBitfieldLValue\` and returned its result directly,
bypassing the \`return e->isPrefix() ? value : input\` logic that
selects old vs new for post vs pre-increment. For post-increment on a
bitfield, this returned the new (incremented) value instead of the old
one, so \`if (s->nRefs++)\` always evaluated true even when \`nRefs\`
was zero on entry.
Fix by assigning the store result to \`value\` and falling through to
the existing prefix/postfix selector, mirroring the non-bitfield path.
Found via the SPEC CPU 2026 abc_r benchmark: \`Cnf_ManScanMapping_rec\`
uses \`if (pObj->nRefs++)\` on a 26-bit bitfield to detect
already-visited AIG nodes. With the bug, every call returned true
(already visited) immediately, producing an empty CNF mapping and a
spuriously satisfiable SAT problem (133 variables instead of 3018).
[CIR] NFC: Clarify Expand insertion-point guard
Gate the field-store insertion point on the same destAlloca condition
that gates emitting the stores. This makes it explicit that when the
CIRGen spill is absent (DCE removed it) the Expand path only reshapes
the signature and emits no stores, so no insertion point is consulted.
When the spill survives, the insertion point is its old slot, which sits
after the CIRGen allocas. No functional change.
audit: serialize truenas_verify baseline against /usr race
setup_truenas_verify generates the as-installed truenas_verify baseline by
reading the entire rootfs. It runs as a first-boot system.ready handler,
concurrently with boot.update_initramfs (another system.ready agent), which
overlays a read-only functioning-dpkg sysext on /usr for the duration of its
truenas-initrd.py rebuild.
When the baseline read hits /usr while that overlay is mounted, it captures
the overlay's dpkg files instead of the installed ones, producing spurious
discrepancies (e.g. '/usr/bin/dpkg: got mode 0o755, expected: 644',
'/usr/local/bin/dpkg: incorrect file type.') and a non-clean install log.
Wrap the do_verify call in rootfs_protection_lock() so it can't overlap the
sysext rebuild. Only caller is audit's run_in_thread(setup_truenas_verify),
so the blocking flock stays off the event loop, and do_verify never calls
back into middleware, so there is no deadlock.
[CIR] Lower __builtin_bswapg (#203618)
C++23 `std::byteswap` lowers every value wider than a single byte
through the type-generic `__builtin_bswapg` builtin, which CIRGen had no
case for, so `std/numerics/bit/byteswap.pass.cpp` hit `errorBuiltinNYI`.
This handles `__builtin_bswapg` the way classic CodeGen does
(`CGBuiltin.cpp`): a bool or single-byte integer is returned unchanged,
and wider values go through `cir.byte_swap`. Unlike the unsigned-only
`__builtin_bswap16/32/64`, the generic builtin also accepts signed
operands, so a signed argument is reinterpreted as unsigned of the same
width before the swap and cast back afterward.
`cir.byte_swap` previously accepted only 16/32/64-bit operands, but
`std::byteswap` instantiates it for `__int128` and wide `_BitInt` too
(the libc++ test reaches `_BitInt(256)`). The operand constraint is
widened to any unsigned integer whose width is a multiple of 16 bits --
which is what `llvm.bswap` requires -- and the existing CIR-to-LLVM
lowering already handles any such width. With the fix,
`byteswap.pass.cpp` passes under `-fclangir`.
[AMDGPU] Guard against opsel selection in V_PK_*64
These instructions do not have OPSEL or ABS so bail on selection.
This does not affect any tests now because v2f64/v2i64 are not legal
for BUILD_VECTOR and alike, but if it is legal it will silently
produce incorrect code. GlobalISel already has this guard.
[flang] Extract misparsed function reference check into function (#203899)
Function calls and array element acceses have the same syntax, and some
array element accesses may be misparsed as calls. The ExprChecker will
identify and correct such cases in expressions, but they may also occur
outside of expressions (e.g. OpenMP directives and clauses).
To avoid code duplication extract the check into a new function
`IsMisparsedFunctionReference`.
18161 dmake(1) could use posix_spawn() to run commands
Reviewed by: Dan Cross <cross at oxidecomputer.com>
Reviewed by: Gordon Ross <Gordon.W.Ross at gmail.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at edgecast.io>