[AMDGPU][NFC] Precommit test for SIFixSGPRCopies PHI-to-AGPR rewrite (#247814)
`processPHINode` moves a VGPR PHI to an AGPR class when all of its uses
are copies to AGPRs. A `DBG_VALUE` use of the PHI blocks the move, so
the class depends on `-g`.
The checks show the current behavior: the PHIs in `phi_agpr_use` and
`phi_agpr_use_64` become `agpr_32` and `areg_64_align2`, while the one
in `phi_agpr_use_dbg_value` stays `vgpr_32`.
This came up in the review of #245761.
Assisted-by: Claude Opus 5.5
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Co-authored-by: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
[flang][OpenMP] Compare complex parts and literal substrings by value
Expr equality had two gaps:
- ComplexComponent inherited Operation::operator==, which ignores
isImaginaryPart, so `real(z)` and `aimag(z)` compared equal.
- Substring compared literal parents by StaticDataObject::Pointer, so
substrings of identical literals, such as `'ab'(i:i)`, never compared
equal.
METADIRECTIVE lowering turns `user={condition(...)}` selectors into an
IF/ELSE chain. Since a condition is false on its ELSE path, Flang drops
the other candidates with the same condition there, using Expr equality
to compare them.
The first gap drops a different condition:
```
!$omp metadirective &
!$omp& when(user={condition(real(z) > 0.0)}: taskyield) &
[26 lines not shown]
[DAG] combineShiftToAVG - match sub(A, not(B)) as avgceil
A - ~B == A + B + 1. DAGCombiner turns add(add(A, B), 1) into
sub(A, not(B)) if preferIncOfAddToSubOfNot is false, as on X86 for
multi-element vectors and on AArch64 for all vectors. D148809 delays
this until after legalization if the add of 1 has nuw or nsw.
combineShiftToAVG does not recognize the sub form, so the ceil average
is lost if the fold runs first. Match the sub form as well. If the not
has other users, only do it when the AVG node is legal or custom.
This shows up when the IR is written as a sub of a not, or when a
freeze is pushed through the adds and drops their flags. With #152107
the latter loses vpavgb/vpavgw in five AVX512F maskz tests of
avg-mask.ll, which match main again with this change.
Where the target expands the AVG node, the sub form now gets the code
of the add form, e.g. on RISC-V P, which has AVGSUBFLOOR but no
AVGCEIL, and for some Hexagon and ARM NEON types.
Assisted-by: Claude Code (Claude Opus 5.5)
[X86][ACEV1] Keep a tile config from resetting a written BSR
ldtilecfg runs bsr_init(), so a config the compiler places between a
BSR write and a read of that value throws the scales away. The config
cannot move above the write, because a call makes it volatile and -O0
puts one at the head of every block that uses tiles.
Mark the configs as writing bsr0, give BSR0 a register class so a
spill has a size, and preserve the value across the configs that
reach a read. Memory forms exist both ways, so this costs four
instructions.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
netipsec: Relabel only an outer IPv6 header that a tunnel built
When transport mode requests follow a tunnel mode request in a bundle,
ipsec_process_done() sets the flow label of the outer IPv6 header from
the outermost SA. It checks only that the policy has such a tunnel
request, not that it was applied. A tunnel request at level use
without an SA is skipped, and a transport request after it, unless it
names a destination other than the packet's, is then applied to the
packet's own header. With a policy such as
"esp/tunnel/A-B/use ah/transport//require", an AH SA between the hosts
and no ESP SA, every IPv6 packet leaves with the label of the AH SA. A
forwarded packet loses the label its source chose, which RFC 6437 asks
forwarding nodes to leave alone, and every flow through that SA gets
the same one.
Record in the packet's output history the mode of the request each SA
was applied for, rather than the SA's own, which may be "any", and
relabel only when the history holds a record of one of the policy's
earlier tunnel mode requests. Nothing else reads the mode in the
[11 lines not shown]
Fix a crash in handling this-pointer captured in nested lambdas in field initializer. (#245491)
Environment.initialize() currently crashes when handling a this-pointer
captured by a nested lambda expression appearing in a field initializer
of a struct. Consider the following example:
```cpp
struct {
int f = int f{[this]() { return [this]() { return 1; }(); }()};
}
```
When handling the this-pointer captured in the inner lambda,
Environment.initialize() tries to get the enclosing record by calling
getLambdaContext() on the lambda's Closure. However, getLambdaContext()
only works for the outermost lambda. For inner lambdas, it just returns
nullptr, which causes a null-dereference.
This PR fixes that issue by introducing a helper function that finds the
outermost lambda and get getLambdaContextDecl() from it.
[flang][OpenMP] Compare complex parts and literal substrings by value
Expr equality had two gaps:
- ComplexComponent inherited Operation::operator==, which ignores
isImaginaryPart, so `real(z)` and `aimag(z)` compared equal.
- Substring compared a literal parent's StaticDataObject::Pointer, so
substrings of two identical literals, such as `'ab'(i:i)`, never
compared equal.
METADIRECTIVE lowering uses Expr equality to drop candidates whose
runtime condition already failed. With
```
!$omp metadirective &
!$omp& when(user={condition(real(z) > 0.0)}: taskyield) &
!$omp& when(user={condition(aimag(z) > 0.0)}: taskwait)
```
the ELSE path of `real(z) > 0.0` dropped the TASKWAIT candidate, so
[9 lines not shown]
[GVN] Treat Deadblock as Available
PRE insert load instruction if there is only one predecessor cannot be
eliminated. A deadblock can actually be treat as Available so that it
doesn't count into the BB that needs to insert load.
ZTS: auto_offline_001_pos: rescan only the scsi_debug host
insert_disk without a host makes scan_scsi_hosts write "- - -" to the
scan file of every SCSI host. On a VM with eight virtio_scsi
controllers, each of those scans takes about 9 seconds: for every LUN
it probes and does not find, the scan allocates a temporary device and
frees it again, and each time the host's shared tag set is updated,
which freezes the queue of the disk behind it. A reattach then takes
about 67 seconds, and the test, which reattaches its disk eight
times, is killed at its 10 minute timeout.
Every other caller of insert_disk passes the host of its device. Do the
same here: record the scsi_debug host before the first removal, while
the device still exists, and rescan only that host.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #20060
[AMDGPU] Precommit test for SIFixSGPRCopies PHI-to-AGPR rewrite
processPHINode moves a VGPR PHI to an AGPR class when all of its uses
are copies to AGPRs. A DBG_VALUE use currently blocks the move, so the
chosen class depends on -g.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
bigger wine update, some key changes of the port summarized here:
- update to version 11.23, the latest release
- switch to new sndio backend (by me and armani@ in collaboration)
- remove USE_WXNEEDED and the corresponding patch in configure.ac;
wine now works with W^X.
- wine gs patching can now to inspected with WINEDEBUG=+gsstats
- futex based sync instead of kqueue
- arc4random instead of /dev/urandom in a few places
- README additions about MIDI use, how to use egdb(1) with wine
(by Andrii)
- and more...
This is the result of effectively several weeks of collaboration and
has undergone a fair amount of testing.
Besides above mentioned, other notable contributions are by Andrii,
fabien@, brynet@.
Caveat: The sndio backend currently only implements the play, but not
[2 lines not shown]
[flang][semantics] Ignore a !DIR$ ALIGN directive that cannot be applied, with a warning (#247762)
The semantic checks of `!DIR$ ALIGN` (244506) made it an error to name
something the directive cannot align, or to put the directive after an
executable statement or outside a program unit. Existing code that other
compilers accept has such directives, for example `!DIR$ ATTRIBUTES
ALIGN` on a named constant, on the name of a derived type or on a
function result, and it no longer compiled.
Make these cases warnings under `-Wignored-directive`, and ignore the
directive for that name. The request is not recorded, so module files
and lowering do not see it. This follows what #180994 did for a
misplaced `IGNORE_TKR`. An alignment that is not a valid power of two
and two different alignments for one name stay errors.
A directive that follows a program unit was checked in the scope of that
program unit. Issuing a warning there aborted the compiler, which
`IGNORE_TKR` already did. Such a directive is now checked in the global
scope. There `IGNORE_TKR` gets its "must appear in a program unit"
[7 lines not shown]
[libc] Reject CPU affinity mask sizes above INT_MAX (#247852)
On Linux, `SYS_sched_getaffinity` and `SYS_sched_setaffinity` take a
32-bit `unsigned int` mask length, while
`linux_syscalls::sched_getaffinity` returns the written byte count as
`int`. Sizes above `INT_MAX` don't fit in `ErrorOr<int>` and narrow to
32 bits at the syscall boundary past `UINT_MAX`.
Return `EINVAL` for mask sizes above `INT_MAX` in
`linux_syscalls::sched_getaffinity` and
`linux_syscalls::sched_setaffinity`, and clear trailing mask bytes with
`inline_memset` in `sched_getaffinity`. Also add tests for trailing
zero-fill and for zero and `> INT_MAX` mask sizes.
Assisted-By: Gemini
[Clang] Check address space overlap for C-style casts to references (#244964)
In OpenCL and SYCL, `TryAddressSpaceCast` rejects a pointer cast between
two address spaces that don't overlap, but a C-style cast to a reference
is not checked (there is a FIXME for it). As a result, `(__local int
&)global_var` is accepted and we emit an `addrspacecast`.
This PR checks such reference casts in the same way. We only check the
case where the reference binds to the operand directly, i.e. the two
types are related. Other casts to a reference are not affected.
This PR was assisted by AI but I reviewed all the changes.
anyraid: allow a child capacity of 65536 tiles
The header of each copy of the AnyRAID tile map records the capacity
of every child, in tiles, as a 16-bit value: the writer stores the
capacity minus one and anyraid_open_existing() adds one back, so
capacities from 1 to VDEV_ANYRAID_MAX_TPD (2^16) round-trip.
vdev_anyraid_open() and vdev_anyraid_expand() cap a child at that
many tiles, so one with room for more gets exactly 2^16. The
assertion in vdev_anyraid_write_map_sync() bounds the capacity by
UINT16_MAX instead, one less.
A debug build thus fails the assertion on the first sync of a pool
with such a child, which is a little over 4 TiB with 64 MiB tiles: at
"zpool create", and when it imports a pool created without
assertions, with the child present or missing. Builds without
assertions record and read the capacity correctly.
Bound the capacity by VDEV_ANYRAID_MAX_TPD. The lower bound stays: a
capacity of 0 would be read back as 2^16, and only a child that holds
[6 lines not shown]
ZTS: create AnyRAID with a child of 2^16 tiles
An AnyRAID child holds at most VDEV_ANYRAID_MAX_TPD (2^16) tiles, and
the header of the tile map records its capacity minus one in 16 bits,
but the writer of the map asserts that the capacity itself fits in 16
bits. A debug build fails that assertion on the first sync of a pool
with a child that holds 2^16 tiles.
Add a test that creates an anymirror1 pool with 16 MiB tiles on two
sparse files of 512 MiB and one of 1025 GiB, which gets 2^16 tiles,
imports it read-only without the large file, so that its capacity is
read from the map, then with it, and scrubs it.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19849