[AMDGPU] Form VOPD3 pairs with pair-local literal moves (#223431)
VOPD3 cannot encode literal operands, but its src0 can read scalar
registers. In this PR, we try to allow to form a pair with one distinct
non-inline constant value by moving that value to a free SGPR. If both
components use the same value, one move serves both, but we reject pairs
that need two different values, since that doesn't buy us anything.
Ffunctions without tracked liveness, and functions optimized for size
are also rejected.
With this change, `GCNCreateVOPD` checks every adjacent pair before it
selects a greedy non-overlapping pair. This lets an infeasible pair fall
through to the overlapping next one. We use one reverse liveness walk to
find an SGPR that is free over each pair-local range. Disjoint selected
pairs can reuse the same SGPR. Each accepted pair adds at most one
`S_MOV_B32` for the one instruction removed by fusion.
The post-RA scheduler uses the same matcher policy, so it will not
cluster a two-value pair that the create pass cannot build.
[4 lines not shown]
[MLIR][Affine] Refactor dependence testing to work on relations, not just on operations (#223188)
This change is effectively NFC for all users of affine dependence
analysis in the tree or outside. It performs a minor refactoring of the
API to allow more general usage.
`checkMemrefAccessDependence` takes two `MemRefAccess`es, each wrapping
an operation, so it can only be asked about accesses that already exist.
A transformation deciding whether to make a change has the opposite
question: whether the accesses it is about to create would depend on
each other. Loop fusion is one -- whether the stores of a slice would
still be one-to-one in the loops it is about to be placed under settles
whether their parallelism survives it, and it has to know before it
fuses.
Nothing in the dependence analysis needs the operations. Everything from
the point where the two access relations are in hand -- inverting one,
composing, adding the ordering constraints, testing the result for
emptiness -- is already relation-only. Split that out as
[12 lines not shown]
[RISCV][GISel] Record SExt32 arguments for RISCVOptWInstrs. (#224154)
RISCVOptWinstrs can do a better job if its know what arguments are
already sign extended.
Assisted-by: Claude
[OpenMPIRBuilder] Use generic pointers for outlined teams arguments (#222176)
createFakeIntVal models the thread and bound id arguments of the
function
outlined for a teams region as allocas. When the target's alloca address
space is not zero these were passed on as-is, so the outlined function
took
addrspace(5) pointers while __kmpc_fork_teams calls it with generic
ones.
Cast the alloca to address space zero when it is passed as a pointer,
which
only affects targets with a non-zero alloca address space such as
AMDGPU.
math/gap: update 4.14.0 → 4.16.1
30+ port options were added for all compiled packages.
This is in addition to non-compiled packages that come with
the base GAP.
ChangeLog: https://github.com/gap-system/gap/blob/v4.16.1/CHANGES.md
kernel - Update comments on PG_BUSY rules with page wirings
* Adjust code comments to reflect that a vm_page's wire_count can transition
from 1->0 without being busied under certain circumstances.
* The pmap system is allowed to do this when removing pages because other
references to the page are still present and there will be no race
against a vm_page freeing operation.
[IR] Avoid collecting COMDATs for non-module printing (#221460)
`AssemblyWriter` scans every global object in its constructor to collect
referenced COMDATs. That collection is only used when printing a
complete module, but the constructor also runs for standalone value and
instruction printing.
Move COMDAT emission into `printModule()`. Print each group at its first
global-object use and keep only a local set to avoid duplicate
declarations.
On `bench/sqlite/original/shell.ll` from `llvm-opt-benchmark`, the
median `opt -passes=dot-cfg` time dropped from 1.65 s to 0.40 s, about
4.1x faster. All 687 generated DOT files matched after normalizing
process-specific node IDs.
[flang-rt] Copy out only the modified suffix of an argument temporary (#222101)
`CopyOutAssign` currently copies the whole temporary back over the
original unconditionally. When the effective argument is not definable —
a named constant, for example — and the callee, conformingly, never
modified it, that copy-back stores unmodified bytes into storage that
may be read-only. With this change, `CopyOutAssign` scans the temporary
for the first element whose bit pattern differs from the original and
copies back only from that element through the end, in one fused pass:
an unmodified copy-out performs no stores at all, so compiler-generated
copy-out can never be the reason a conforming program writes into
read-only storage. The comparison is bitwise, which is exact here
because the temporary was created as a bitwise copy by `CopyInAssign`:
unmodified elements compare equal even for NaNs and padding bytes, which
a value comparison would misjudge.
The change is performance-neutral in practice (measurements summarized
in a comment below): copy-out's destination is essentially always
discontiguous — the temporary exists only because the actual argument
[11 lines not shown]
update the list of amdgpu files to build with sse
following the linux Makefiles it is amd/display/dc/dml*
and dcn401_soc_and_ip_translator.c
dml2_top_legacy.c is excluded as we don't build it
prompted by a shorter diff from daniel@
kernel - Fix cryptsetup bug / fix bug in mlockall()
* mlockall() uncovererd an old bug in the VM system that was previously
masked by other code. The VM system going way way back assumed that
wired pages were already wired and that at worst only a zero-fill was
needed, so the TRYPAGER() macro checked for the case.
However, when issuing a mlockall(), the refactored VM system uses
vm_fault() to bring in missing wired pages to satisfy the request,
was hitting the old condition, and doing a zero-fill instead.
* This caused cryptsetup() (one of the few programs to actually use
mlockall()) to seg-fault under typical conditions.
* Fix by removing that part of the conditional. Regardless of the
wiring flags, the pager is still tried for non-default VM objects.
Reported-by: mneumann, aly
[clang][Modules] make ActOnPrivateModuleFragmentDecl return non-null on success. (#223757)
his code
```cpp
module;
module :private;
export module Foo;
```
a Private module fragment here is illegal because it can only be
declared in a primary module interface unit, instead of raising an error
clang crashed because of this assertion
```cpp
assert((!getLangOpts().CPlusPlusModules ||
SeenGMF == (bool)this->TheGlobalModuleFragment) &&
"mismatched global module state");
```
the mismatch happened because `ParseModuleDecl` assigned ImporState
wether or not it was semantically correct:
```cpp
[12 lines not shown]
kernel - Fix pmap wiring bug
* Fix a pmap wiring accounting bug. The refactored wiring and pmap code
expects only a single increment for a pmap wiring when the "W" bit
transitions from 0 to 1, plus a count on the vm_page.
Found-by: Claude Sonnet 5 (aly)
uipc_usrreq: Fix unix-domain socket inode assignment.
1. `if (unp->unp_ino == 0) unp->unp_ino = unp_ino++' would assign
zero the first time around by mistake, and then assign nonzero
after that. `if (unp->unp_ino == 0) unp->unp_ino = ++unp_ino'
avoids this silliness.
2. Make the ++unp_ino part atomic.
PR kern/60729: incosistent st_ino from the first stat(2) on a socket
[Attributor] Only seed live internal callees during deduction (#222226)
When a basic block becomes live, assumeLive marks its internal callees
live to seed attributes for deduction. Currently, this also happens when
a liveness AA is initialized during MANIFEST or CLEANUP, after the
fixed-point iteration has finished.
In CGSCC runs, cleanup can query the liveness of a shared caller for
each callee SCC. Seeding all internal callees in that caller's live blocks
can then cause quadratic initialization work.
Restrict this bulk seeding to SEEDING and UPDATE. Continue recording
live blocks and allow on-demand attribute queries in the later stages.