[lldb] Set the default clang module cache path in TypeSystemClang (#229817)
`ModuleListProperties` calls
`clang::driver::Driver::getDefaultModuleCachePath`, so `lldbCore` links
`clangDriver`, which drags in `clangAST` and most of LLVM via static
initializers. lldb-server only links `lldbCore` and links everything
else regardless.
Set the default from `TypeSystemClang::Initialize` instead. Every tool
that uses the clang module cache registers TypeSystemClang.
[CodeGen] Force compiler to generate default destructor for class (#229944)
The LazyMachineBlockFrequencyInfoPass has global visibility so in order
for it to be linkable with MSVC, we need to explicitly tell the compiler
to emit its definition.
[CIR] Destroy coroutine body locals before the implicit co_return (#229743)
When a coroutine body flows off its end, CIRGen calls the promise's
`return_void()` while the local variables of the body are still alive,
and destroys them afterwards.
Flowing off the end of the function-body is equivalent to a `co_return`
with no operand. Control only flows off the end of the function-body
when it leaves the body's block, and leaving the block destroys the
block's automatic variables.
This patch wraps the body in a `RunCleanupsScope`, so the body's
cleanups are popped when the body ends, before the fall-through handler
is emitted. The body's `cir.cleanup.scope` now ends with a `cir.yield`,
and `return_void()` and `cir.co_return` follow it.
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lldb] Intern SB API strings in the system pool (#229901)
Intern strings returned by SB classes that do not belong to a debugger
in the system pool. Rename StringPool::GetSystem to GetSystemPool and
add StringPoolRef::InternNonEmpty for getters that map an empty string
to nullptr. SBEnvironmentTest now initializes the SB API, as the system
pool is only valid between Initialize and Terminate.
Bail out of zil_create() when the pool suspends
zil_create() waits with txg_wait_synced(), a void wrapper around a
plain wait that cannot report a suspend. When the pool suspends while
it waits, the fsync() that got there does not return until the pool
resumes.
The rest of the commit path already handles this. zil_commit_flags()
and zil_commit_writer_stall() wait with TXG_WAIT_SUSPEND, call
zil_crash() on ESHUTDOWN and hand EIO back to the waiters.
zil_create() and zil_commit_activate_saxattr_feature() were left on the
old wait, so a suspend caught in either one still hangs.
Use the suspend-aware wait in all three places and return the failure.
zil_process_commit_list() already has a NULL-lwb path that signals the
nolwb waiters with the error, and its comment already says an ESHUTDOWN
there means zil_crash() was called, so the failure lands somewhere that
expects it.
[11 lines not shown]
Bail out of the objset upgrade when the pool suspends
The two objset upgrade callbacks end with txg_wait_synced(), a void
wrapper around a plain wait that cannot report a suspend. When the
pool suspends during that wait, the upgrade taskq thread stays blocked
until the pool resumes. So does dmu_objset_disown(), which calls
dmu_objset_upgrade_stop(). That waits for a running upgrade task to
finish and then waits for a txg itself.
Give all three waits TXG_WAIT_SUSPEND. The callbacks return EAGAIN,
which dmu_objset_upgrade_task_cb() records in os_upgrade_status.
zfs_ioc_userspace_upgrade() and zfs_ioc_id_quota_upgrade() return that
status, and libzfs reports EAGAIN as a suspended pool.
dmu_objset_upgrade_stop() ignores the result, as it ignored the old
wait.
On master, fstests generic/753 in the eio group hangs with the pool
suspended and z_upgrade blocked here:
[10 lines not shown]
Do not wait forever in spa_vdev_state_exit() on a suspended pool
spa_vdev_state_exit() waits for the txg to sync whenever it is given a
vdev, so that zpool(8) commands are synchronous. If the pool suspends
during that wait, the txg never syncs and the command never returns.
A pool that is already suspended does not get that far.
ZFS_IOC_VDEV_SET_STATE refuses it with EAGAIN before vdev_online()
runs, and zfs_ioc_clear() passes NULL instead of the vdev when
spa_suspended() is true. The hang needs the pool to suspend after
those checks. That happens when the state change's own sync fails,
and when a zpool clear races a new suspend, which generic/753 in the
eio group caught on an encrypted mirror:
zpool D 357s txg_wait_synced <- spa_vdev_state_exit
<- zfs_ioc_clear
txg_sync D 359s
pool SUSPENDED
[24 lines not shown]
Stop DMU_TX_NOWAIT callers spinning on a suspended pool
On a suspended pool, dmu_tx_assign() gives a DMU_TX_WAIT caller EIO
under failmode=continue and blocks it under failmode=wait. A
DMU_TX_NOWAIT caller gets ERESTART in both modes, and every such caller
answers it the same way:
if (error == ERESTART) {
waited = B_TRUE;
dmu_tx_wait(tx);
dmu_tx_abort(tx);
goto top;
}
dmu_tx_assign() sets tx_break_on_suspend for any caller without
DMU_TX_SUSPEND, so this dmu_tx_wait() waits with TXG_WAIT_SUSPEND and
returns as soon as it sees the suspended pool. It returns void, so the
caller retries at once, and the thread spins in the kernel until the
pool resumes. dmu_tx_assign() guards its own retry against this by
[26 lines not shown]
[DAG] Handle widened step vectors in expandGetActiveLaneMask
On AVX512 getLegalMaskAndStepVector will need to widen the step vector type. Handle this in expandGetActiveLaneMask, so we don't crash on AVX512 which widens e.g. v8i1 -> v16i1. We don't actually use Mask, it's just a dummy poison value to work out what type the final mask result should be.
[Offload][AMDGPU] Wire HSA profiling into GenericProfiler abstraction
Add device profiling infrastructure to the AMDGPU plugin so that the
GenericProfiler can receive nanosecond-accurate kernel execution and
data transfer timestamps from the HSA runtime.
Key changes:
- Add ProfilingInfoTy struct to transport HSA profiling data
- Add timeKernelInNsAsync/timeDataTransferInNsAsync callbacks that
extract dispatch/copy times from HSA signals and call
handleKernelCompletion/handleDataTransfer on the profiler
- Add getOrNullProfilerSpecificData helper to extract ProfilerData
from AsyncInfoWrapperTy
- Add getDeviceTimeStamp() override using hsa_system_get_info
- Add getSystemTimestampInNs() for HSA system timestamp queries
- Add schedProfilerKernelTiming/schedProfilerDataTransferTiming to
StreamSlotTy for scheduling profiler callbacks on stream slots
- Thread ProfilerSpecificData through pushKernelLaunch,
pushMemoryCopyH2DAsync, pushMemoryCopyD2HAsync, pushMemoryCopyD2DAsync
[6 lines not shown]
LiveVariables: Only visit tracked physical registers
Keep a bitvector of physical registers with a recorded def or use in
the current block. Register mask handling, the end of block scan, and
the per-block reset now only visit those registers instead of every
register. This is significant for targets with many registers, such as
AMDGPU.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
LiveVariables: Remove dead live-in handling and Defs plumbing
No physical register is tracked at the start of a block, so handling
the block live-ins was a no-op. The Defs list was only appended for
instruction defs, which runOnInstr already collects.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
CodeGen: Strip LiveVariables down to dead flag computation (#230149)
This analysis is dead and there are no more explicit uses. There are still
passes implicitly relying on adjustments of dead flags. Missing dead
flags are added, and implicit-def operands are added for partially dead
physical registers.
The whole pass should be deleted, but it's taking a while to get all the
dead flag changes through the rest of the compiler. As a stop-gap to try to
recover some compile time regression, and avoiding new users appearing, strip
the pass down to only computing the dead flags.
The main side effect of this is kill flags are no longer made accurate, which
is the source of the test churn.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
*/*: depend on llvm-libs for libLLVM and libclang
libLLVM and libclang moved to the devel/llvmNN-libs ports, so packages
record llvmNN-libs for these LIB_DEPENDS while the Makefiles still named
the full devel/llvmNN. Poudriere saw a "new dependency" on every run and
rebuilt them, which cascaded through mesa to most of the tree.
Point the runtime dependency at the -libs port and keep a build
dependency on the full llvm for headers, llvm-config and cmake files.
spirv-llvm-translator and opencl-clang only do this for flavors that
have a -libs port. rpcs3 now strips -libs when deriving LLVM_DIR.
X86: Only drop EFLAGS def in convertToThreeAddress if MI defines EFLAGS
convertToThreeAddress unconditionally removed the EFLAGS value at the
converted instruction's slot. For instructions that do not define EFLAGS,
such as masked moves converted to blends or the _NF variants, a live-through
EFLAGS value could be removed leaving a missing segment.
Reported in https://github.com/llvm/llvm-project/pull/225174#issuecomment-6056927367
Co-authored-by: Claude (Claude-Opus-5.5)