[LV] Have ExtractValue match the shape of the operand. (#229927)
Previously, BuildStructVector would create a vector of a wide struct
type, where each element is widened.
This can cause issues, if a transform turns an extractvalue of a wide
call into a single-scalar (e.g. makeScalarizationDecisions), because we
currently cannot extract lane 0 from a struct of vectors.
Instead of relying on BuildStructVector, we can instead have the
ExtractValue match the shape of its operand (either widen if the operand
is wide, or replicated if the operand is scalar). If a vector value is
needed, we can directly use the existing BuildVector.
This fixes a number of crashes in the newly added tests, including
https://github.com/llvm/llvm-project/issues/229609.
Depends on https://github.com/llvm/llvm-project/pull/229925
PR: https://github.com/llvm/llvm-project/pull/229927
VE: Use i32 registers for 32-bit loads in the SjLj dispatch block
Fix verifier errors in exception test. The call site index and the
PIC jump table offset were loaded with ldl.zx, which defines an i32
register, into vregs with the i64 register class.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
VE: Default to SjLj exception handling
The clang driver selects SjLj exceptions for VE (96d4ccf00c8f), but the
triple defaulted to no exception model. Make SjLj the default for the
triple and MCAsmInfo so llc agrees with the driver.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc] Order GPU targets after the generated stdint.h (#231229)
Several GPU targets reach `<stdint.h>` without depending on the
generated header, so a fresh build can compile them before or while
`stdint.h` is written and fail with `unknown type name 'uint32_t'`. This
is the same race as #149993, but via headers that don't include
`<stdint.h>` directly.
- GPU utils: `utils.h` includes `<gpuintrin.h>`, which includes
`<stdint.h>`; depend on `libc.hdr.stdint_proxy`.
- rpc_client: `shared/rpc_util.h` includes `<stdint.h>` but is also used
outside libc, so it can't use the proxy header; declare the dependency
on the libc target instead.
- GPU time_utils: declare its existing dependency on GPU utils.
This also changes GPU fixedbuffer to include `hdr/stdint_proxy.h` rather
than `<stdint.h>`. fixedbuffer was added after #150303, so it was missed
by that conversion.
[4 lines not shown]
AMDGPU: Add vgpr32_lo16/vgpr32_hi16 OutPatFrags
Add OutPatFrags for extracting a 16-bit half of a value after copying
it to a VGPR_32, and use them for the existing open-coded instances.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU][Doc] Add documentation about ABI occupancy
This PR introduces ABI occupancy in documentation. The actual code
implementation will be in follow-up PRs.
ARM: Generate processor family and architecture lists in backend
ARMTargetParserDef.inc is only included by ARMSubtarget. It was
generated by the TargetParser library's tablegen step, which every
other LLVM library depends on, even when the ARM target is not
built. Generate it with the rest of the ARM backend's tablegen outputs
instead.
This removes 14% of the time in the TargetParser tablegen step, along
with a dependency on 71 ARM td files.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ip_encap: Recompute flowid for packets received over tunnel
Packets decapsulated by a tunnel interface carry the NIC's flowid
computed over the outer tunnel tuple, which is the same for every
flow a peer carries. Therefore mpath nhop selection places all
traffic on one path.
Add encap_set_flowid() to ip_encap.c, which rehashes a decapsulated
IP packet on its inner addresses.
The feature is off by default and is enabled with the per-vnet
net.route.hash_inbound sysctl.
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D60552
VE: Use i32 registers for 32-bit loads in the SjLj dispatch block
Fix verifier errors in exception test. The call site index and the
PIC jump table offset were loaded with ldl.zx, which defines an i32
register, into vregs with the i64 register class.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Skip the second duplicate search when adding to an nvlist.
nvlist_add_common() removes any existing pair with the same name and
then calls nvt_add_nvpair(), which hashes the name and searches the
table for that pair again. The second search can never find anything.
Only the unpack path needs it, because it does not remove duplicates
first.
nvt_add_nvpair() now takes a flag and nvlist_add_common() skips the
search. The search also checked whether the hash table should shrink.
That check still runs on every removal.
In a perf profile of ZFS_IOC_POOL_STATS on a pool with 1200 disks the
second search was about 16% of the samples. A userland test that
builds and copies 200000 lists of 41 pairs went from about 2.42
seconds to about 2.00 seconds.
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Reviewed-by: Ameer Hamza <ameer.hamza at truenas.com>
[2 lines not shown]
unit/nvpair: confirm pair count after replace
Replacing a pair needs to update both the nvlist hashtable and the pair
list. The other replace tests use lookups, which only check the
hashtable. This checks the pair count in three different ways, none of
which use the hashtable, and so ensure that the pair list was also
updated correctly.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Co-authored-by: Caleb St. John <yocalebo at gmail.com>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19362
[flang][OpenMP] Destroy composite num_threads temporaries once
DISTRIBUTE PARALLEL DO and DISTRIBUTE PARALLEL DO SIMD evaluate the
PARALLEL clause operands before creating omp.parallel, using the
statement context of the dispatch. That context is finalized after the
returned omp.distribute, which is inside the parallel region, so every
thread destroyed the same num_threads temporary, for example for
num_threads(size(f())) where f returns an allocatable.
Evaluate these operands in a separate statement context and finalize it
after omp.parallel.
Fixes #230661
Assisted with Copilot and Claude Opus 5.5
unit/nvpair: test other nvlist types where possible
nvlists can have three possible types or modes: allow duplicate keys, require
unique keys, require unique key+type. For the most part we were only
testing the one we use most commonly in OpenZFS, NV_UNIQUE_NAME.
This sets up test parameters covering each type, and converts a lot of
the tests to run against each type. Not all tests can be used for all
types, most notably; name lookup doesn't currently work for non-unique
types.
A couple of tests are converted to use pair iterators instead of
lookups, so we can still test non-unique types there, but not all, as
it would be impractical for the very complex tests.
Finally, we confirm that unsupported functions for particular types do
return ENOTSUP, to ensure that if that changes in the future, the tests
will fail and so remind the programmer to update the tests.
[4 lines not shown]
unit: unit_unreachable(); abort test on reaching unreachable code
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19362
AMDGPU: Use lo16_to_vgpr32/hi16_to_vgpr32 OutPatFrags
Replace open-coded REG_SEQUENCE widenings of 16-bit values into a
VGPR_32 with the existing OutPatFrags.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR] Move records through memory in x86_64 call lowering
CIR lowers a union to its storage type, so moving one as an SSA value
can drop bytes. An x86_fp80 member stores only 10 of its 16 bytes, for
example. The calling-convention rewriter now passes records through
memory at every coercion site, the way classic CodeGen does. That lets
us drop the union check #230302 added, which broke std::format.
Assisted-by: Cursor / Claude Opus 5.5
VE: Default to SjLj exception handling
The clang driver selects SjLj exceptions for VE (96d4ccf00c8f), but the
triple defaulted to no exception model. Make SjLj the default for the
triple and MCAsmInfo so llc agrees with the driver.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc] Implement fgetpos/fsetpos (#221349)
These functions read/write the file state, specifically the offset and
the multibyte state. This PR adds them as well as fpos_t, the struct
they manipulate, and thorough tests.
Assisted-by: Automated tooling, human reviewed.
[AMDGPU][SplitModule] Add entry points for unreachable call cycles
A function in a call cycle always has an incoming direct call, so
`SplitGraph` never makes it an entry point. If no kernel and no other
entry point reaches the cycle, the cycle is assigned to no partition.
This can hit an assertion in `verifyGraph`.
In this PR, we visit the unreached nodes in reverse post-order of the
direct call edges, and make each node that is still unreached an entry
point. Only the outermost unreached cycles get one, so their callees
are not copied into other partitions.
[NFC][AMDGPU] Add a test showing unreachable call cycles in module splitting (#230983)
If no entry point reaches a call cycle, `AMDGPUSplitModule` creates no
entry point for it. In assertion builds, `verifyGraph()` fails. In
release builds, no partition defines the functions in the cycle.
Add a test that shows the current crash.
Fix out-of-bound access when resizing in receive_spill
receive_spill will call dbuf_spill_set_blksz, which in turn calls
dbuf_new_size when resizing spill block. However, receive_spill holds
a raw buf, which can be compressed and less than db_size. This causes
an out-of-bound access when dbuf_new_size tries to copy the data using
db_size as length.
To fix this, we just disable the copy when coming from receive_spill,
since we will assign a new arc_buf later anyway.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Chunwei Chen <david.chen at nutanix.com>
Closes #18861
games/oblige: prepare the port for FLTK 1.4
- Drop silly meaningless FLTK version check
- While here, normalize UT_Swap16() patches
Fixes: 6483d7e6e5f3
ZTS: test that metadata failing in two classes is ganged
On a pool with a special vdev, a metadata block that can't be
allocated in the special class falls back to the normal class. If
that fails too, it should be written as a gang block. Add a test that
forces every allocation of 1500 bytes or more to fail and checks that
a sync finishes and the meta-dnode's blocks are gangs.
This fails now: the sync never finishes, while z_wr_iss threads spin
in zio_dva_allocate().
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Closes #19256
Closes #19304
spa: make the normal class the last allocation fallback
Since 108562344 a block that fails to allocate falls back to the class
spa_preferred_class() picks next, but that only knows the class the
block is in now. A metadata block that failed in the special class
and then in the normal class is sent back to the special class, and
from there to the normal class again: zio_dva_allocate() never reaches
the gang fallback, and txg_sync waits forever while z_wr_iss threads
spin. #19256 reports a nearly full pool with a special vdev that hangs
this way on import.
Fallbacks only ever move towards the normal class, so once a block is
there, stay and let the caller gang it, as before 108562344.
This makes gang_blocks/gang_blocks_special_fallback pass.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Closes #19256
Closes #19304