[lldb][DWARFASTParserClang] Handle pointer-to-member-data non-type template (#187598)
## Description
### Problem
MakeAPValue in DWARFASTParserClang.cpp did not handle
pointer-to-member-data non-type template parameters (e.g., template <int
S::*P>), causing LLDB to produce incorrect results or crash.
DWARF encodes pointer-to-member-data NTTPs as
`DW_TAG_template_value_parameter` with a `DW_AT_const_value`
representing the byte offset of the member within the containing struct.
MakeAPValue is responsible for converting this value into a clang
APValue, but it only handled integer/enum and floating-point types. For
pointer-to-member types, it returned `std::nullopt`.
This caused the caller (ParseTemplateDIE) to fall back to creating a
type-only TemplateArgument (kind=Type) instead of a value-carrying one.
When two specializations differ only by which member they point to
[209 lines not shown]
[BOLT] Support buildid in pre-aggregated profile (#186931)
Sample addresses belonging to external DSOs (buildid doesn't match the
current file) are treated as external (0).
Buildid for the main binary is expected to be omitted.
Test Plan:
added pre-aggregated-perf-buildid.test
[lldb] Mark lldbtest.build() parameters as keyword-only (#188327)
This reinforces what is already true in the codebase: all uses of
`build()` use keyword arguments.
With this change, it will be an error to call `build` using positional
arguments:
```
TypeError: build() takes 1 positional argument but 2 were given
```
[BOLT] Support buildid in pre-aggregated profile
Sample addresses belonging to external DSOs (buildid doesn't match the
current file) are treated as external (0).
Buildid for the main binary is expected to be omitted.
Test Plan: added pre-aggregated-perf-buildid.test
Reviewers:
paschalis-mpeis, maksfb, yavtuk, ayermolo, yozhu, rafaelauler, yota9
Reviewed By: paschalis-mpeis
Pull Request: https://github.com/llvm/llvm-project/pull/186931
[BOLT] Add profile format documentation (#186685)
Create bolt/docs/profiles.md documenting all accepted profile formats:
perf.data, fdata, YAML, and pre-aggregated. Covers collection methods,
format syntax, examples, and known limitations.
Add reference from bolt/docs/index.rst.
tcp_usrreq: Only allocate TFO counter when required
During tcp_usr_listen(), only allocate TFO counter when required.
Reviewed by: tuexen, glebius
Differential Revision: https://reviews.freebsd.org/D56067
x11/xcursorgen: Concise description
Substitute file for theme, remove "a collection of" to eliminate jarring
line wrapping at reference console width, and improve search keywords.
Differential Revision: https://reviews.freebsd.org/D55699
[llvm][SPIRV] Add pass to lower Ctors/Dtors for SPIRV (#187509)
This PR adds a new SPIRV pass that generates a kernel named
"spirv$device$init" that iterates the pointers in the table pointed by
__init_array_start and __init_array_end and executes them. It also
generates symbols for each constructor with the form
__init_array_object_NAME_PRIORITY.
These symbols will be used by the Level Zero plugin in the liboffload
runtime (with the support introduced by #187510) to generate the
aforementioned table as spirv-link cannot create the table itself.
It also does the same thing for destructors, with the kernel name being
"spirv$device$fini", the table pointers __fini_array_start and
__fini_array_end, and the generated symbols prefix __fini_array_object.
The code was mostly generated by Claude 4.5 and has been reviewed by me
to the best of my ability.
Revert "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, ppc128float and others in GlobalISel) (#155107)" (#188344)
This reverts commit b1aa6a45060bb9f89efded9e694503d6b4626a4a and commit
ce44d63e0d14039f1e8f68e6b7c4672457cabd4e.
This fails the build with some older gcc:
llvm/include/llvm/CodeGenTypes/LowLevelType.h:501:35: error: call to
non-constexpr function ‘static llvm::LLT llvm::LLT::integer(unsigned
int)’
return integer(getSizeInBits());
^
tests/netinet: add test for getsockname() on a disconnected TCP socket
Stack it into existing file that exercises an other corner case of our
TCP and rename the file to a more generic name.
[InstallAPI] [Tests] Avoid checking compiler output for 'error' (#188307)
We have two tests that use FileCheck for diagnostics and which try to
check that the output contains no compiler errors by checking for the
string 'error'. The issue with this approach is that this also causes
those tests to fail if the *path* contains the word 'error', which can
happen e.g. if the branch name contains the word 'error'.
Instead, we now check for `error:` since that string is much less likely
to appear in a path.
[lldb] Fix immediately-destroyed ScopedTimeout in KillProcess (#188333)
The ScopedTimeout was created as a temporary, causing it to be destroyed
immediately and the timeout to have no effect. Give it a name so it
lives until the end of the function scope.
[SLP] Fix infinite loop in ordered reduction worklist processing (#188342)
The ordered reduction support introduced in 94e366ef2060 can cause an
infinite loop when processing complex reduction chains. The worklist
algorithm re-adds instructions from PossibleOrderedReductionOps when
switching to ordered mode, but doesn't track which instructions have
already been processed. This allows instructions to be re-added and
processed multiple times, creating cycles.
Add a Visited set to track processed instructions and skip any that
have already been handled, preventing the infinite loop.
[ORC] Add EPCGenericJITLinkMemoryManager::Create named constructor. (#188191)
Create takes a JITDylib and a SymbolNames struct, looks up the
implementation symbol addresses in the given JITDylib, and uses them to
construct an EPCGenericJITLinkMemoryManager instance. This makes it
easier for ORC clients to construct the memory manager from named
symbols (e.g. in a bootstrap JITDylib) rather than raw addresses.
[clang][AST] Fix LazyGenerationalUpdatePtr NumLowBitsAvailable on 32-bit (#188318)
The `PointerLikeTypeTraits` for `LazyGenerationalUpdatePtr` claimed
`PointerLikeTypeTraits<T>::NumLowBitsAvailable - 1` spare low bits. This
assumed that the inner `PointerUnion<T, LazyData*>` has `T_bits - 1`
spare bits, which is only true when `alignof(LazyData) >= alignof(*T)`.
On 32-bit systems, `LazyData` (containing pointers and `uint32_t`) has
`alignof = 4`, giving `LazyData*` only 2 low bits. With `T = Decl*` (3
bits due to `alignas(8)`), the inner `PointerUnion` has `min(3,2) - 1 =
1` spare bit, but the PLTT claimed `3 - 1 = 2`.
Historically, the formula was correct when introduced in 053f6c6c9e4d --
at that time `Decl` had no alignment annotation, so `T_bits ==
LazyData*_bits` on all platforms. It became outdated when 771721cb35f3
added `LLVM_ALIGNAS(8)` to `Decl`, raising `Decl*` to 3 bits on 32-bit
while `LazyData*` stayed at 2. The old `PointerIntPair`-based
`PointerUnion::doCast` happened to mask with `minLowBitsAvailable()`
(tolerant of overclaims), so this was never exposed until the
[5 lines not shown]
[SelectionDAG] Add known bit for `ISD::FABS` (#188335)
Absolute value always clears the sign bit, so make that knowh to
selectionDAG's `computeKnownBits`.
Fix implicit val for OpenMP >= 52 and don't rely on static variables in processLinear
- Emit val for implicit linear clause if openmp version >= 52
- Turn `typeAttrs` and `linearModAttrs` from static to local to
avoid confusions about cleaning stale value
Fix implicit val for OpenMP >= 52 and don't rely on static variables in processLinear
- Emit val for implicit linear clause if openmp version >= 52
- Turn `typeAttrs` and `linearModAttrs` from static to local to
avoid confusions about cleaning stale value
[libc][strings] Refactor load_aligned for cleaner endianness handling (#186360)
Replace the explicit `if constexpr` branching for big and little
endianness with compile-time calculated shift constants `VAL_SHIFT` and
`NEXT_SHIFT`. This simplifies the logic and reduces code duplication,
relying on the compiler to constant-fold the zero shifts into no-ops.