[libc][CndVar] reimplmement conditional variable with FIFO ordering (#192748)
This PR reimplements conditional variable with two different variants:
- futex-based shared condvar with atomic counter for waiters
- queue-based private condvar
Notice that thread-local queue node cannot be reliably accessed in
shared processes, so we cannot use a unified implementation in this
case.
POSIX.1-2024 (Issue 8) added atomicity conditions to conditional
variable:
- The `pthread_cond_broadcast()` function shall, **as a single atomic
operation**, determine which threads, if any, are blocked on the
specified condition variable cond and unblock all of these threads.
- The `pthread_cond_signal()` function shall, as a **single atomic
operation**, determine which threads, if any, are blocked on the
[41 lines not shown]
[DirectX] Implement lowering of Texture Load and Texture .operator[] (#193343)
Fixes https://github.com/llvm/llvm-project/issues/192546 and
https://github.com/llvm/llvm-project/issues/192558
This PR defines the TextureLoad DXIL Op (opcode 66), and implements
lowering of the texture load (dx_resource_load_level) intrinsic to the
DXIL op.
This PR also implements the transformation of loads from texture
resources (via dx_resource_getpointer) into dx_resource_load_level
intrinsics.
Assisted-by: Claude Opus 4.7
[AMDGPU] Add a sched group mask for LDSDMA instructions
The existing VMEM masks are not fine-grained enough for some use cases. For
example, if users want to control async loads, using VMEM may cause the compiler
to pick instructions it shouldn't.
This PR adds a new sched group mask for LDSDMA instructions. It is a subclass of
VMEM, but only targets isLDSDMA instructions.
[CIR][NFC] Delete unnecessary errorNYI call in emitDelegateCallArg (#193608)
There was a call to errorNYI in `CIRGenFunction::emitDelegateCallArg`
when the parameter decl was a `CXXRecordDecl`. This was an artifact from
an older version of this function in classic codegen, which called
`ErrorUnsupported` for InAlloca arguments, but that handling was deleted
as part of https://reviews.llvm.org/D154007.
[LV][RISCV] Add explicit LMUL controls via computeFeasibleMaxVF
Add components of maxVF and its support for scalable
vectorization. The default for unspecified RISCV is
LMUL=4 with this change, so some tests will have
the flag that controls max LMUL to extend to LMUL=8
when the request is made.
lang/fpc: Add infrastructure to bootstrap on macOS
Does compile all the way, but still fails linking and I couldn't figure
out yet why. Rather than throwing it all away, I guess it's better to
commit it with BROKEN_ON_PLATFORM.
[lldb] Update filecheck_log to use direct input (NFC-ish) (#193618)
Pass log files as direct input to `FileCheck` via its `-input-file`
option.
I had a failing test case where the log file contains the string being
checked for, and yet `FileCheck` failed. While debugging, I noticed the
output from running `platform shell -h -- cat ...` was somehow
truncated. I have not debugged why. As soon as I saw the issue, I
figured it was best to skip all the intermediaries, and pass the log
file straight to `FileCheck`.
linuxkpi: Implement __GFP_THISNODE in alloc_pages()
It indicates to `alloc_pages()` to allocate the pages from the current
NUMA domain. If it couldn't, it should not retry elsewhere and return
failure.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56590
pf_purge_states() may trip assert(st->timeout == PFTM_UNLINKED)
in pf_free_state(). Once member ->timeout in pf_state structure
reaches PFTM_UNLINKED value, then the ->timeout member must not
not be updated. This diff reminds pfsync(4) to follow PFTM_UNLINKED
rule too. The pfsync(4) currently may accidentally update ->timeout
member while state is being purged, causing pf_purge_states() to
trip the assert.
Issue was kindly reported by Stuart Henderson.
OK @bluhm
[SPIR-V] Handle ASM with multiple outputs (#187128)
Inline ASM that writes to multiple registers is represented as a struct
returning call in LLVM IR. We did not handle this properly, as we
mutated the callsite, but did not correctly retrieve the type during
lowering to SPIR-V. Furthermore, IRTranslator tries to do some clever
things when lowering ASM, which are completely unhelpful to SPIR-V,
which merely wants to pass the original ASM through. This patch
correctly retains the IR type and cleans up the IRTranslator introduced
noise, matching how the SPIRV-LLVM Translator would handle such cases.
There is probably a cleaner reformulation of this to be had when we
rework the entire callsite mutation infra.
<!-- branch-stack-start -->
<!-- branch-stack-end -->
---------
Co-authored-by: Marcos Maronas <marcos.maronas at intel.com>
Co-authored-by: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
Ensure that the Synthetic children of a ValueObject are managed by their parents ClusterManager (#192561)
A very common pattern in our synthetic child providers was to make the
child ValueObject using ValueObjectConstResult::Create or some form of
the static ValueObject::CreateValueObjectFrom*** methods, and store and
hand that out as the child. Doing that creates a "root" ValueObject
whose lifecycle is not linked to the lifecycle of the ValueObject it is
a child of. And that means it is possible that either the child or the
parent could have gotten destroyed when the other ValueObject gets asked
a question about it.
For the most part this doesn't happen because there are usually enough
other shared pointer references binding the two to keep both sides
alive. But we have gotten a small but steady stream of reports for years
now of crashes where a ValueObject accesses its ClusterManager but that
has already been deleted. I've never been able to find a reproducible
case of this, but one plausible cause is that we are violating the
contract that "all the children of a ValueObject have coterminous
lifespans, enforced by the ClusterManager". So it is unsurprising that
[31 lines not shown]
18034 libscf: deadlock in `scf_value_set_from_string` with some invalid values
Reviewed by: Andrew Stormont <andyjstormont at gmail.com>
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
dpaa2: ni: add more stats and link information
In addition to the locally generated statistics counters, dpaa2 ni
provides a larger set of counters than we currently export via
sysctl. Add (most of) the missing counters and descriptions.
Around Page 3/4 there are some things left to do if we want.
Also the manual was not clear on the descriptions of 3/0 and 3/1.
The second half of the change adds another sysctl note which exports
the link-state, speed, and capabilities set as a text-blob. This is
especially interesting in case the "ni" stops passing packets.
From what I have found in that case the (internal) link state of the
ni goes DOWN but we do not see an interrupt for a link-state change.
Being able to diagnose the state helps to (manually) fix it for now
by changing the media status to 10BaseT or none and then back to auto.
That usually brings the internal link state back UP.
PR: 279352
[4 lines not shown]
ZTS: fix trim test portability for FreeBSD
Replace GNU-specific du flags (--block-size, -B1) and dd conv=nocreat
with POSIX compatible commands. Move -O flag before pool name in
zpool create to align with FreeBSD's strict POSIX getopt(). Relax vdev
size thresholds in trim_config to account for ZFS-on-ZFS overhead.
Add sync_pool before zpool trim -w to ensure freed blocks are committed
before trimming.
Skip zpool_trim_partial, zpool_trim_verify_trimmed, trim_config, and
autotrim_config on FreeBSD where trim does not reclaim space on file
vdevs stored on a ZFS filesystem within the test framework.
Tested on FreeBSD 16.0-CURRENT: 26 PASS, 4 SKIP, 0 FAIL.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18398
ZTS: remove outdated FreeBSD skip from trim tests
FreeBSD has supported hole punching via fspacectl(2) since
FreeBSD 14.0 and the test library already handles this using
truncate -d. Remove the skip that prevented trim tests from
running on FreeBSD.
Tests will still skip if the hardware does not support
TRIM/UNMAP, which is checked separately via diskinfo.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18398