[NVVM][NVPTX] Support decompress_b feature for tcgen05.mma intrinsics (#216312)
Support `decompress_b` feature for `tcgen05.mma` intrinsics in the
NVVM/NVPTX flow.
[runtimes] Escape list separators when forwarding search paths (#216169)
`CMAKE_PREFIX_PATH` and `CMAKE_PROGRAM_PATH` are forwarded to the
runtimes sub-build as `-D` arguments, but a CMake list is just a
semicolon-separated string, so `list(APPEND)` splits a multi-entry path
across several elements. The sub-build is then configured with only the
first entry, and the rest become stray positional arguments to cmake.
Configuring with `-DCMAKE_PREFIX_PATH="/aaa;/bbb"
-DCMAKE_PROGRAM_PATH="/ccc;/ddd"` and `-DLLVM_ENABLE_RUNTIMES=libunwind`
produces this runtimes configure command today:
```
-DCMAKE_PREFIX_PATH=/aaa
/bbb
-DCMAKE_PROGRAM_PATH=/ccc
/ddd
```
[13 lines not shown]
[libc] Update NSIG value and usage on Linux. (#217481)
* Increase NSIG to 65 - one greater than the maximal possible value
allowed for a signal. POSIX doesn't reference NSIG constant itself, but
is explicit (after Issue 8 / Austin Group Defect 741) that SIGRTMAX
should be strictly less than sysconf(_SC_NSIG) and all SIG* constants
should be strictly less than NSIG_MAX
(https://pubs.opengroup.org/onlinepubs/9799919799/). Note that other
libc implementations on Linux (e.g. glibc and musl) also define NSIG as
the value greater than SIGRTMAX.
* Fix a handful of uses/comments to reflect the updated semantics.
* Add `_NSIG` alias to the same value for compatibility.
[libc] Implement sysinfo (#217471)
Adds the public sysinfo function and tests. The internal wrapper already
existed. I decided to avoid defining `struct sysinfo` since it's a
kernel struct defined in the UAPI headers. Can revisit in future if
necessary.
Assisted-by: Automated tooling, human reviewed.
[clang][OpenMP] Fix thread count upper bound for target directives
Fix the UpperBound-computing ternary, which was inverted: std::min is
only reachable when UpperBound is 0, where it is a no-op, so any clause
with a bound to combine simply overwrites it.
Two consequences:
- A clause can raise the bound above a smaller one.
'target teams distribute parallel for thread_limit(8) num_threads(64)' gets a bound of 64.
- A non-constant clause pins the bound at 0 and discards every constant
clause after it, losing the bound entirely.
Additionally, let a construct split over separate 'target', 'teams' and
worksharing directives find its num_threads clause, so it agrees with
the combined spelling.
Note that the codegen changes in
`clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp` and
`clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp`
[5 lines not shown]
[lldb] Add MSVC STL formatter for std::expected (#217243)
Pretty-print MSVC STL `std::expected<T, E>` and `expected<void, E>`.
Engaged values show `Value`; unexpected alternatives show `Unexpected`.
The anonymous union is walked the same way as `optional` so PDB debug
info still finds `_Value` / `_Unexpected`.
Tests: generic C++23 MSVC STL coverage for engaged, unexpected, void,
and reference cases using PDB debug info.
Part of #24834
Assisted-by: Grok 4.6
Assisted-by: codex-5.6-high
---------
Co-authored-by: Bjorn Schobben <bjorn.schobben at aimsport.com>
[VPlan] Expand negated add operands as a subtract in VPSCEVExpander. (#215253)
Update VPSCEVExpander to try to expand adds of negative values as
subtract, instead of adding the negated operand. This matches IR
SCEVExpander behavior and improves expansions slightly.
It also avoids regressions when expanding more expressions.
Alive2 Proof: https://alive2.llvm.org/ce/z/Emgeqv
Depends on https://github.com/llvm/llvm-project/pull/215252
[clang][win] Fix __global_delete breaking __attribute__((used)) (#217753)
The `__empty_global_delete` fallback introduced in #209585 was marked
used via `llvm::appendToUsed()`, which creates a global named
"llvm.used" during codegen. `CodeGenModule::emitLLVMUsed()` later
unconditionally creates its own global of that same name at end-of-TU,
so the name collision renamed the latter to "llvm.used.1" -- a name LLVM
ignores. The result was that every `__attribute__((used))` global in the
TU silently lost its used semantics whenever a `__global_delete` wrapper
was emitted, letting those symbols be dropped.
Mark the fallback used via `CodeGenModule::addUsedGlobal()` instead, so
it joins the single llvm.used that `emitLLVMUsed()` emits.
`emitLLVMUsed()` runs well after `emitGlobalDeleteForwardingBodies()` in
`Release()`, so the fallback is still recorded in time.
Fixes a regression reported on #209585.
[SSAF][EntityPointerLevel] Add an intermediate data structure DeclPointerLevel
A DeclPointerLevel differs from an EntityPointerLevel only in that it
retains the AST Decl node instead of abstracting it to an Entity. The
AST node carries more information, such as types, that can be used by
extractors before converting DeclPointerLevels to EntityPointerLevels.
E.g., PointerFlowExtractor can use it to compute the upper bound on
pointer levels for an entity. It is needed for fixing the bug reported
in rdar://183529483.
First step for:
rdar://183529483
[Verifier] Diagnose local scope chains that miss their DISubprogram
DILocalScope::getSubprogram() casts every parent to DILocalScope, so a
DILexicalBlock parented to a non-local scope such as a DIFile makes the
verifier abort on that cast before visitDILexicalBlockBase can report
"invalid local scope".
[libc++][tests] Enable 'simd_unary.pass.cpp' test for Armv7 Linux targets. (#217807)
Remove test's XFAIL for the `armv7-unknown-linux-gnueabihf` target
because the ARM codegen has been fixed and does not crash with the
assert anymore.