AMDGPU/GlobalISel: Fix cs_chain use of constrainOperandRegClass (#212248)
Make a copy before constraining to avoid setting register class on
a register that can be defined by generic opcode.
[InstCombine] Copy metadata in select-to-masked.load fold (#211965)
Preserve AA metadata when folding select of masked.load to masked.load.
We cannot preserve value metadata, as it may not be valid for the new
passthru.
Fixes #209022.
Assisted-by: Claude
sound: Propagate error value from dsp_make_dev()
It is better to propagate it to pcm_register(), and later to the device
drivers, than to simply ignore it and return ENXIO.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
[mlir][OpenMP] Fix update of linear iteration variables (#183800)
The final value of a linear iteration variable must be the loop
limit_value + step. Before this patch it was limit_value.
Fixes #170784.
[flang] Wire allocation-placement into the optimizer pipeline (experimental)
Add a hidden -enable-allocation-placement flag that, when set, replaces the
stack-arrays and memory-allocation-opt passes in the default FIR optimizer
pipeline with the unified allocation-placement pass. The flag is off by
default, so the legacy passes remain the default path and behavior is
unchanged.
When enabled, the pass runs with its default byte-size thresholds; the
-fstack-arrays strategy is forwarded through the new stackArrays option.
[flang] Remove legacy stack-arrays and memory-allocation-opt passes
The unified allocation-placement pass now supersedes both the heap-to-stack
stack-arrays pass and the stack-to-heap memory-allocation-opt pass, and is the
default in the FIR optimizer pipeline. Remove the two legacy passes: their
TableGen definitions, the MemoryAllocation.cpp source, the memory-allocation-opt
command-line options, the enable-allocation-placement fallback switch, and the
addMemoryAllocationOpt pipeline helper. The pass-only portions of
StackArrays.cpp are dropped while its analysis and rewrite pattern, now shared
with allocation-placement, are kept.
The legacy tests are retargeted onto allocation-placement to show it reproduces
both prior behaviors: the stack-arrays tests use "stack-arrays=true", and the
memory-allocation-opt tests use the default policy (runtime-sized and big
constant-size temporaries go on the heap).
[flang] Enable allocation-placement pass by default
Make the unified allocation-placement pass the default in the FIR optimizer
pipeline in place of the legacy stack-arrays and memory-allocation-opt passes,
by defaulting -enable-allocation-placement to true. Passing
-enable-allocation-placement=false restores the legacy passes for comparison.
Add a -disable-allocation-placement switch that skips the pass entirely (wired
through addAllocationPlacement like the other optimizer passes), so codegen
tests can opt out of placement policy independently of the legacy fallback.
Update the pipeline-dump tests to expect AllocationPlacement, and disable the
pass in the alloca/allocmem codegen tests (alloc.fir, coordinateof.fir) so they
keep testing lowering rather than placement policy. Document the unified pass,
its policy, thresholds, and options in fstack-arrays.md.
[flang] Add policy-driven allocation-placement pass
Introduce a new function-level pass, allocation-placement, that unifies the
stack/heap placement decisions currently split between the stack-arrays and
memory-allocation-opt passes. For each array allocation it consults a policy
to decide whether it should live on the stack (fir.alloca) or the heap
(fir.allocmem) and rewrites it accordingly, reusing fir::replaceAllocas for
stack-to-heap and the StackArrays analysis/rewrite for heap-to-stack (so
heap-to-stack only happens where it is provably safe).
The default policy (AllocationPlacementPolicy.h) is threshold-driven:
- small constant-size arrays go on the stack within a per-function stack
budget, otherwise on the heap;
- big constant-size arrays: user variables stay on the stack, temporaries
go on the heap;
- runtime-sized arrays go on the heap;
- an aggressive mode places all arrays on the stack (best effort).
User variables are distinguished from compiler temporaries via the presence
of a uniqued name. A hook lets downstream users override the thresholds per
[4 lines not shown]
[flang][NFC] Extract StackArrays analysis and rewrite into a header
Move InsertionPoint, StackArraysAnalysisWrapper, and AllocMemConversion
out of the anonymous namespace in StackArrays.cpp into a new
StackArrays.h header (in namespace fir), so the "which fir.allocmem can
be safely moved to the stack, and where" analysis and the heap-to-stack
rewrite pattern can be reused by other passes.
The dataflow internals (AllocationState, LatticePoint, AllocationAnalysis),
the command-line options, and all method definitions remain in the .cpp.
No functional change intended.
nfs_commonkrpc.c: Handle NFSERR_DELAY for Sequence correctly
Unlike RFC5661 (the original NFSv4.1 RFC), RFC8881 specifies
that a NFS4ERR_DELAY reply to the SEQUENCE operation requires
a reply using the same slot/sequence#.
This patch fixes handling of this case, so it conforms to
RFC8881.
Reported by: J. David (j.david.lists at gmail.com)
Tested by: J. David (j.david.lists at gmail.com)
MFC after: 1 week
devel/llvm-devel: pre llvm23 branch snapshot
This is the last commit before the version of main was bumped to 24.
It is intended as a standin for an LLVM 23 release candidate port while
we wait for tarballs from RC1 or RC2.
Sponsored by: DARPA, AFRL
krb5: Install profile.h again
Commit 1876de606eb8 exposed missing symbols that the port security/krb5
installed that the base system did not install. Part of the solution
was to make libprofile.so private (not libprofile.a) just as the port
does, Red Hat Enterprise Linux does, and as installing MIT KRB5 by hand
does. The actual fix for this was to put symbols and their corresponding
functions into the correct librarires, i.e. libkrb5.so and othes, just
as the port, Red Hat, and manually installed via tarball do.
Unfortunately INTERNALLIB disables the include of bsd.incs.mk and the
install of header files. This is still needed to install profile.h into
/usr/include (just as the port installs it into ${LOCALBASE}/include
and RHEL installs it in /usr/include). This commit fixes this by
installing profile.h into /usr/include from the krb5/include Makfile.
Reported by: fluffy
Tested by: fluffy
Reviewed by: fluffy
[3 lines not shown]
[ConstraintElim] Skip decomposition if precondition does not hold. (#212140)
Currently we fully decompose expressions, collect all preconditions and
then bail out if any precondition is false. This means we miss out on
simplifications in cases where the precondition does not hold, but we could
still reason about the un-decomposed sub-expression.
This patch updates `decompose` to take the constraint system as argument
instead and eagerly check preconditions. If the precondition does not hold,
we don't decompose the sub-expression and don't further recurse, but simply
treat the sub-expression as variable.
This improves results in some cases
(https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/794)
and is also slightly cheaper (or neutral) in most cases compile-time
wise, as we cut off decomposition before recursing further. The number of queries
for preconditions overall should stay the same
PR: https://github.com/llvm/llvm-project/pull/212140
[AMDGPU] RewriteMFMAFormStage: single exit copy for same-block uses (#209179)
When multiple VGPR-requiring uses of an MFMA dst are in the
same block as the MFMA, share a single AGPR->VGPR copy placed
before the earliest use, instead of creating one per use.
AMDGPU/GlobalISel: Fix cs_chain use of constrainOperandRegClass
Make a copy before constraining to avoid setting register class on
a register that can be defined by generic opcode.