Fix profile metadata propagation for umax in InstCombine
Synthesize branch weights for select instructions created from umax intrinsics to satisfy profile verification requirements.
rpc: correct resultproc_t's type
It takes exactly three arguments of known type.
Tweak the types of various resultproc_t functions to match the type (mostly
added const to struct pointers) allowing us to drop casts.
Effort: CHERI upstreaming
Reviewed by: vangyzen, glebius
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D54941
clnt_broadcast(3): fix eachresult argument type
The `eachresult` argument is documented to take a function pointer of
type:
bool_t (*)(caddr_t, struct sockaddr_in *)
It was declared to take a resultproc_t which has historically been
declared to be:
bool_t (*resultproc_t)(caddr_t, ...);
This overlapped well enough for currently supported ABIs where variadic
arguments are passed in registers, but this declaration is misaligned
with the documentation (resultproc_t takes three arguments) and will be
fixed in a followup commit.
Fix the type to be non-variadic, matching callbacks, and define a
convenience type of as most callbacks take something other than a char *
[6 lines not shown]
clnt_broadcast(3): don't free function pointers
Replace use of thr_getspecific/thr_setspecific to stash the function
pointer we're smuggling between clnt_broadcast and rpc_wrap_bcast with a
simple thread local variable. Clear it after use so the reference
doesn't linger.
In the relatively unlikely event clnt_broadcast was called from threads
that exited prior to program termination, the previous code called free
on a function pointer, which is undefined and might corrupted allocator
state.
Effort: CHERI upstreaming
Reviewed by: glebius, jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D54939
[HLSL][Codegen][NFC] Simplify intrinsic picking (#179300)
A pattern developed to do WaveActive intrinsics in their own helpers
because some wave intrinsics on spirv lack a signed\unsigned variant.
In the case of Min and Max the variants exist on both DirectX and SPIRV.
That means we can do away with a specialized helper.
[libc++] Implement a type-safe iterator for optional (#154239)
Create a new `__capacity_aware_iterator` iterator type which wraps an
existing iterator, takes its container as a template parameter, and
encodes the maximum amount of elements the container can hold. The main
objective is to prevent iterator mixups between different containers
(e.g. `vector`).
[lld-macho] Fix branch relocations with addends to target actual function (#177430)
When a branch relocation has a non-zero addend (e.g., `bl _func+16`),
the linker was incorrectly computing `stub_address + addend` instead of
`function_address + addend`. This caused the branch to land in the wrong
location (past the stub section) rather than at the intended interior
point of the function.
The fix checks for non-zero addends on branch relocations and uses the
actual symbol VA in those cases. This makes sense semantically—branching
to an interior offset implies reliance on the original function's
layout, which an interposed replacement wouldn't preserve anyway.
Added test `arm64-branch-addend-stubs.s` that verifies the correct
behavior using `-flat_namespace` (which makes local symbols interposable
and thus routed through stubs).
[Assisted-by](https://t.ly/Dkjjk): Cursor IDE + claude-opus-4.5-high
[AMDGPU] Return two MMOs for load-to-lds and store-from-lds intrinsics
Accurately represent both the load and the store part of those
intrinsics.
The test changes seem to be mostly fairly insignificant changes caused by
subtly different scheduler behavior.
commit-id:0269189c
[CodeGen] Refactor targets to override the new getTgtMemIntrinsic overload (NFC)
This is a fairly mechanical change. Instead of returning true/false,
we either keep the Infos vector empty or push one entry.
commit-id:c7770af6
[CodeGen] Add getTgtMemIntrinsic overload for multiple memory operands (NFC)
There are target intrinsics that logically require two MMOs, such as
llvm.amdgcn.global.load.lds, which is a copy from global memory to LDS,
so there's both a load and a store to different addresses.
Add an overload of getTgtMemIntrinsic that produces intrinsic info in a
vector, and implement it in terms of the existing (now protected)
overload.
GlobalISel and SelectionDAG paths are updated to support multiple MMOs.
The main part of this change is supporting multiple MMOs in
MemIntrinsicNodes.
Converting the backends to using the new overload is a fairly mechanical step
that is done in a separate change in the hope that that allows reducing merging
pains during review and for downstreams. A later change will then enable
using multiple MMOs in AMDGPU.
commit-id:b4a924aa
[AutoUpgrade] Prevent deletion of call if uses still exist (#177606)
The calls to the llvm.x86.sse2.pshuflw are being deleted due to invalid
vector type, even though uses still exist. Adding checks to prevent
deletion of call when uses still exist or even if eraseFromParent() is
called ensuring it is called after replaceAllUsesWith().
Fixes: #176674
Reapply "[lldb] Add FP conversion instructions to IR interpreter" (#179022)
This reapplies #175292 with the fixed test. The original test used
integer types with different bit widths on different platforms.
----- Original message:
This allows expressions that use these conversions to be executed when
JIT is not available.
[RISCV] Split RISCVLSUMOP tablegen class for type safety. NFC
Since loads and stores have overlapping encodings we should have
different classes to make sure they stay separate.
Pull up following revision(s) (requested by riastradh in ticket #2003):
tests/lib/libc/sys/t_sigtimedwait.c: revision 1.3
tests/lib/libc/sys/t_sigtimedwait.c: revision 1.4
tests/lib/libc/sys/t_sigtimedwait.c: revision 1.5
sys/kern/sys_sig.c: revision 1.59
sys/kern/sys_sig.c: revision 1.60
sys/kern/sys_sig.c: revision 1.61
t_sigtimedwait: Spruce up and add tests for interruption by signal.
PR standards/59586: sigwaitinfo() returns ECANCELED instead of EINTR
- POSIX compliance violation
sigtimedwait(2): Return EINTR, not ECANCELED.
The return value ECANCELED was a vestige of the logic to implement
sigtimedwait(2) in the SA (scheduler activations) era of NetBSD
[38 lines not shown]
NAS-139532 / 26.0.0-BETA.1 / Allow updates from 26.04 to 26.0.0 (#18120)
This has to be an exceptional cause, because with current update logic
26.0.0 is considered a lower version than 26.04