[flang][acc] Add missing dependencies for TestOpenACCSupport (#222996)
Adds missing dependencies to avoid:
undefined reference to `mlir::acc::getOrCreateGPUModule` undefined
reference to `mlir::acc::OpenACCSupport::getVariableName` after
https://github.com/llvm/llvm-project/pull/222815
[WebAssembly] Select relaxed_trunc for vector fptosi/fptoui with +relaxed-simd (#214148)
Fixes #211273
When `+relaxed-simd` is enabled, plain vector `fptosi`/`fptoui` from `<4
x float>` to `<4 x i32>` is still lowered to
`i32x4.trunc_sat_f32x4_{s,u}`. The relaxed SIMD instructions already
exist in the backend, but they were only wired to the
WebAssembly-specific `llvm.wasm.relaxed.trunc.*` intrinsics—not to
generic `fptosi`/`fptoui` IR.
This matters for frontends like LDC that emit ordinary `fptosi` for SIMD
casts (e.g. `_mm_cvttps_epi32`-style code). With
`+simd128,+relaxed-simd`, we should prefer
`i32x4.relaxed_trunc_f32x4_{s,u}`, which typically lowers more
efficiently
on native SIMD hardware.
The fix adds two TableGen selection patterns in
[19 lines not shown]
Reject negative trait scores during metadirective recovery
Reachability analysis can rank candidates before CheckTraitScore diagnoses
invalid scores. A score of -1 wraps the initial unsigned score to zero,
causing selection to dereference a null best candidate.
Treat negative scores as absent during recovery while preserving the
existing diagnostic.
[AMDGPU] Add getLDSAllocGranule to TargetParser
Expose the LDS allocation granule from GPUKind and subarch without an
MCSubtargetInfo. Use the dedicated granularity features and consolidate
backend users on the byte-valued query.
Change-Id: Ic0c9345e7657ec3c6978a646628598cb7608b390
[AMDGPU] Model LDS allocation granularity with subtarget features
Add numeric LDS allocation granularity features, expose them through the TargetParser feature bitset, and use them in the existing backend query.
Generic targets select the largest covered allocation granularity so their resource calculations remain conservative.
Change-Id: Icdd501d008c9d3cd566bdc8bde4a75d566ecb90a
[AMDGPU] Add getLocalMemorySize to TargetParser
Add getLocalMemorySize and getAddressableLocalMemorySize, both taking a
GPUKind or a Triple::SubArchType, so the LDS a work-group gets can be
queried from a GPU name alone without an MCSubtargetInfo. The first
returns the physical block available in the current mode, the second
caps it at what one work-group can address, mirroring the IsaInfo pair.
The number of SIMDs a work-group runs on is a per-kernel mode rather
than a property of the GPU, so it stays a parameter. GCNSubtarget
initializes its cached sizes from the new entry points. There is no
functional change.
Change-Id: Ib71428b66032a231ed491d6294122b359abfe7e2
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
[CostModel][X86] Add variable divisor div/rem costs for scalar and <=i32 vectors (#215124)
Div and rem by a variable divisor have no X86 cost entry at all, so they
fall through to the BasicTTI default and cost 1. A 20 to 40 cycle
unpipelined instruction ends up priced the same as an add.
That mattered less while vector integer division always scalarized,
since the price was wrong but the decision was usually right anyway.
After #205263 the <=i32 shapes lower through a float divide, so the
vector cost model is now describing a sequence that really exists and it
still prices it as scalarization.
This adds scalar entries plus five feature gated vector tables.
Numbers are the maximum llvm-mca Block RThroughput across the CPUs that
fold the shape with the low power lines excluded (atom and jaguar).
Vector entries take the max within the tier a CPU's feature level
selects, since the lookup takes the first matching table. Scalar takes
it across all of them.
[12 lines not shown]
[HLSLSemanticSignatures] Implement the stacked packing of elements (#218060)
This change defines a testing harness for the packing algorithms of
semantic signatures.
Then implements the stacked packing algorithm.
Resolves: https://github.com/llvm/llvm-project/issues/205875
Assisted by: Claude Opus 5 and GPT-5.6 Sol
[lldb][Fortran] Added DWARFASTParser for Fortran (#218024)
This PR adds the DWARFASTParserFortran class returning nullptr. This is
intended to add the necessary classes for subsequent PRs to add
features.
Changes:
- Adds DWARFASTParserFortran class.
Part of the Add Fortran support to LLDB GSoC 2026 project.
Relates to #109119.
if_bridge: pull up only the headers bridge_pfil() inspects
bridge_pfil() pulled up min(m_pkthdr.len, max_protohdr) bytes. When the
mapped head is shorter than that and followed by an unmapped (M_EXTPG)
mbuf -- a sendfile(2) or KTLS segment from a member advertising
IFCAP_MEXTPG -- m_pullup() ran into it and dereferenced a NULL mtod(),
panicking the kernel.
Pull up the Ethernet header first, and the SNAP/LLC header only for an
802.3 frame. This is similar to pf and ip_output().
m_pullup() and m_copyup() asserted only the first mbuf; assert inside both
copy loops so the shape trips the check.
Fixes: c38abd64dbc1 ("if_epair: support IFCAP_MEXTPG")
Suggested by: markj
Reviewed by: markj, gallatin
Assisted-by: Claude Code (Fable 5, Opus 5)
if_bridge: count the drops on the fragmentation path
bridge_pfil() returned a fragmentation failure without counting it,
and bridge_fragment() dropped a chain on three allocation failures
without counting those either.
Count the first on the filtered interface and the others with
ips_odropped, which is what ip_fragment() uses for the same failure
and what bridge_fragment() already uses for its success case.
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D59391
Assisted-by: Claude Code (Fable 5, Opus 5)
zfs: spa_sync_upgrades() should only take lock when needed
"zfs get -Hp ..." command got into waiting for memory allocation
while holding READER lock as dmu_objset_hold holds dp_config_rwlock READ
via dsl_pool_hold.
pageout was freeing memory by pushing some pages to swap zvol,
but got waiting for txg_wait_synced() and the memory was not freed.
txg_sync thread: spa_sync -> spa_sync_upgrades ->
rrw_enter(&dp->dp_config_rwlock, RW_WRITER) blocked.
This scenario did lead to investigation if spa_sync_upgrades() is
actually correct about requiring writer lock and it turns out that
we only do need write lock for three cases, where upgrade does change
DSL name space.
In other cases, and to check uberblock versions, we do not need
to set this lock.
[3 lines not shown]
ZTS: inject latency into initialize online/offline test
Fast vdevs can finish initialization before the online/offline test
checks progress and suspends it. Moving the suspend command earlier
only narrows this race window.
Inject a 20 ms write delay with one lane on the disk being initialized
so the test can observe progress and suspend initialization. Keep the
original online/offline assertions and clear the injection during
cleanup before destroying the pool.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Matthias Goergens <matthias.goergens at gmail.com>
Closes #19024
Decline Direct I/O reads on a file handle after a benign verify failure
A Direct I/O read verifies the block checksum over the caller's buffer
after the read completes, to catch the buffer being modified while the
read is in flight. When an application recycles its O_DIRECT read
buffers across concurrent requests -- QEMU's block layer does this -- a
queued read can overwrite the buffer before the previous read's verify
runs. The verify then fails even though the data on disk is correct:
ZFS discards the direct read, re-reads the block through the ARC, and
emits an ereport.fs.zfs.dio_verify_rd. The returned data is correct and
the pool stays healthy, but under concurrent load the stream of failed
verifies and buffered re-reads is a real cost and can stall the
workload (#18610).
Once a file handle hits one of these benign failures -- a DIO read
verify that failed but whose buffered re-read then succeeded, proving
the on-disk data good and the buffer caller-modified -- decline Direct
I/O for reads on that handle for the rest of its life and route them
through the existing uncached buffered path. An application that uses a
[29 lines not shown]
[lldb] Add test variants to build directory name (#222792)
Fix testing with shared build directories to no longer share build
directories between build variants.
For example, use a different build directory for dwarf and dsym
variants, to prevent one variant's build artifacts from being used by
the other.
Assisted-by: claude
[LLVM] Add zlib compressed data magic to LLVM magic
RFC 1950 CMF/FLG with a 32K window is four well-defined headers, which
is what LLVM's compress2 emits. Recognize those the same way as zstd so
callers can name either stream without defaulting unknown bytes to zlib.
[Offloading] Add support for compressed OffloadBinary types
Summary:
Offload binaries are used to store many heterogenous architectures into
a singel offloading blob. These lists can get very large so this PR adds
the option to compress them with the LLVM provided compression
libraries.
The implementation is quite simple, we simply compress all the buffers
after the header into a single compressed blob, then re-construct the
header. Extracting is the reverse.
The biggest change is that the offload binary now **owns** the memory,
whereas before we simply took a reference to it. This is necessary
because the decompression must create new memory compared to what the
user provided. This adds an extra copy internally, but it also
simplifies the V2 additions.
This does not wire up any clang/HIP support, just providing the
functionality.