[NFC][AMDGPU] Add tests for fptrunc folded into V_MAD/FMA_MIX (#219723)
V_MAD/FMA_MIX{LO,HI} compute the multiply or multiply-add in f32, round
that to f32, and then convert the f32 result to the 16-bit destination.
That is the same pair of roundings the IR performs, so the instructions
are a bit-exact match for an fptrunc of an f32 multiply or multiply-add
and need no contract flag.
The tests pin that across gfx803, gfx900, gfx906, gfx90a and gfx1100
with +real-true16 for f16, and gfx1250 in both true16 modes for bf16.
Where a shape appears both unflagged and with contract, the two must
select the same instructions.
Assisted-By: Claude Code Opus 5
[AMDGPU] Narrow provably-I32 address offsets
Add a `tryNarrowToI32()` function that uses KnowsBits to detect 64-bit
offests that could be in a 32-bit register, allowing us to match
base + offset cases that don't involve literal base + (ext offset)
nodes.
Apply this to global_* instructions and the scalar memory instructions
that take a scalar offset.
This does leave a few dead copies when we have to bail out of the SMEM
handling for creatining a negative offset, but those don't have
end-to-end effect and it looks like you could already get dead MOVs
from that codepath.
AI disclosure: Claude wrote the code, I looked at it.
[AMDGPU] Add getLDSAllocGranule to TargetParser
Model LDS allocation granularity with subtarget features derived from
AMDGPUGenericAnyFeature. Generic targets can select a granularity present
on any covered GPU, independently of their addressable LDS size.
Expose the byte-valued query for GPUKind and subarch and consolidate
backend users on it. gfx9-4-generic uses gfx950's 1280-byte granule while
retaining its 64 KiB addressable LDS capacity.
Test feature membership, granularity assignments, query overloads and
fallbacks, and generic-target LDS block rounding.
Change-Id: Ic0c9345e7657ec3c6978a646628598cb7608b390
[AMDGPU] Classify generic-target features (#223179)
Classify features used by generic targets but absent from some covered
GPUs as AMDGPUGenericAnyFeature. This covers the gfx11 workarounds,
gfx12.5 register fixup and WMMA timing, and LDS size and bank count.
Derive the classified features directly from the SubtargetFeature
subclass and preserve their existing predicates. Keep RequiresCOV6
outside this policy because it is specific to generic targets and
absent from their covered GPUs.
Test the real target definitions, missing support for classified
features, and the existing all-member requirement for instruction
capabilities.
Merge tag 'cifs-fixes-7.3-rc4' of https://git.manguebit.org/linux
Pull smb client fixes from Paulo Alcantara:
"A batch of bug fixes for the smb client:
- Fix multiple out-of-bounds reads and use-after-frees in the SMB2/3
receive path that are reachable from a malicious or compromised
server: a stale next_buffer pointer and an integer overflow in
compound encrypted frame handling, missing minimum-PDU-size and
per-sub-PDU length validation before parsing command-specific
response fields, missing bounds checks in DFS referral, server
interface list, EA list, POSIX SID, snapshot enumeration and SMB1
reparse point parsing
- Fix use-after-frees and races in multichannel and connection
teardown, including an interface freed while still in use when
adding channels, a server used after its channel reference was
dropped, a reconnect work item left queued after the server is
freed and an uninitialized reconnect list node
[38 lines not shown]
[AMDGPU] Pre-commit tests for narrowing offsets in address matching
When trying to match either SADDR+VADDR global_* or the s_load_* that
takes a 32-bit offset, we don't check for cases where a 64-bit value
is trivially truncatable to 32 bits. Add tests for these cases.
AI disclosure: Claude wrote these tests
[libc++] Make std::exp constexpr for float and double since C++23
Now that __builtin_exp and __builtin_expf are constant-evaluable in
clang (#199808), mark libc++'s float, double, and integral-promoting
overloads of __math::exp as _LIBCPP_CONSTEXPR_SINCE_CXX23. The long
double overload stays non-constexpr because __builtin_expl is not
constant-evaluable yet.
Add constexpr coverage for std::exp and std::expf to the clang-specific
constexpr <cmath> test.
Co-Authored-By: Claude Fable 5.1 <noreply at anthropic.com>
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"Four driver fixes, three of which are minor and one of which (fnic)
tries to add some logic to try to avoid MSI-X being ineffective if
hyperthreading is disabled.
The core fix adds validation to mode sense buffer sizes because it is
used by ATA and could, theoretically, be exploited by a specially
crafted USB device that can simply be plugged in to any laptop or
server"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()
scsi: fnic: Fix missed link-up when critical IRQ targets offline CPU
scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m
scsi: qla2xxx: Fix the ql2xfc2target parameter description
scsi: pm80xx: Fix the use_msix, use_tasklet and read_wwn parameter descriptions
[clang][flang][OpenMP] Fix context selector matching and scoring
Incorrect context selector matching and scoring can select the wrong
variant function or metadirective replacement.
Compute device-selector weights from the enclosing construct-context
depth. For example, inside a `parallel` region:
| Selector | Before | After |
| ------------------------ | ------ | ----- |
| `device={kind(cpu)}` | 2 | 3 |
| `construct={parallel}` | 2 | 2 |
Previously, the incorrect tie allowed candidate order to determine the
winner. The device selector now receives the higher score.
Track enclosing constructs even when they have no corresponding selector
property. Stop at and include the innermost `target`, or retain the full
enclosing context when there is no `target`. Exclude `section` separators:
[43 lines not shown]
[VPlan] Remove dead per-lane loop from VPScalarIVStepsRecipe::execute. (#224399)
replicateByVF already materializes every lane of a VPScalarIVStepsRecipe
as its own single-scalar clone, folding the lane offset into the clone's
start index (addLaneToStartIndex).
During execute, each VPScalarIVStepsRecipe has exactly its single lane
used.
Replace it with the lane-0 body and an assert. Note that this removes a
few redundant add start, 0.
PR: https://github.com/llvm/llvm-project/pull/224399
[AMDGPU] Narrow provably-I32 address offsets
Add a `tryNarrowToI32()` function that uses KnowsBits to detect 64-bit
offests that could be in a 32-bit register, allowing us to match
base + offset cases that don't involve literal base + (ext offset)
nodes.
Apply this to global_* instructions and the scalar memory instructions
that take a scalar offset.
This does leave a few dead copies when we have to bail out of the SMEM
handling for creatining a negative offset, but those don't have
end-to-end effect and it looks like you could already get dead MOVs
from that codepath.
AI disclosure: Claude wrote the code, I looked at it.
[AMDGPU] Pre-commit tests for narrowing offsets in address matching
When trying to match either SADDR+VADDR global_* or the s_load_* that
takes a 32-bit offset, we don't check for cases where a 64-bit value
is trivially truncatable to 32 bits. Add tests for these cases.
AI disclosure: Claude wrote these tests
resterm: Update to 1.8.2
You can now choose which requests get recorded, exported requests and mocks are
named after their method and path instead of a number,, and the recorder
is visible in the header and status bar.
Skip and only filters
Exports named from the request
Recorder in the header and status bar
[Clang] Move DeclContext::getEnclosingFunction/castEnclosingFunction out of line (#224711)
In DeclBase.h, clang::FunctionDecl is only forward-declared. Commit
c9074cfd0d95 defined getEnclosingFunction() and castEnclosingFunction()
inline in DeclBase.h, which instantiates dyn_cast<FunctionDecl> and
cast<FunctionDecl> on an incomplete type when DeclBase.h is compiled
standalone (e.g. with -fmodules / header units).
Move the non-const definitions to DeclBase.cpp where FunctionDecl is
complete, and delegate the const overloads via const_cast, matching
getOuterLexicalRecordContext() and
getEnclosingNonExpansionStatementContext().
Change prepared by Jetski and reviewed by me.
[libc++][pstl] Implementation of parallel std::uninitialized_(copy|move)(_n) based on parallel __for_each (#223229)
This PR adds an implementation of parallel versions of
`std::uninitialized_copy`, `std::uninitialized_copy_n`,
`std::uninitialized_move` and `std::uninitialized_move_n`.
Implementations are mostly one-liners under the hood, but require
dealing with iterator ranges, hence `std::uninitialized_copy` and
`std::uninitialized_move` are implemented in `cpu_algos`.
`std::uninitialized_copy_n` and `std::uninitialized_move_n` are
implemented in the `default` backend.
Fixes #103640
Fixes #134592
Fixes #134593
Part of #99938