[LangRef][MemoryBuiltins] Add support for CHERIoT's heap_allocate and heap_free functions. (#245094)
This requires relaxing the LangRef requirement that `allockind(free)`
functions must return `void`. CHERIoTRTOS' primary heap free API
`heap_free` returns an integer error code, necessitating this change.
Once integer-returning `allockind(free)` functions are permitted, we
also add an extensible path for looking up the return value to substitue
in the case where `free(alloc(...))` is elided. For now we require this
to be 0.
[clang-format] Use formatted breaks to align trailing comments (#246023)
With Allman braces, the first formatting pass can pad a block comment
after a closing brace to align it with a comment after `else`. The
second pass removes that padding because the brace now starts a line in
the input.
Use the formatter's recorded line-break decision when checking the
closing brace. Fall back to the original whitespace when the token has
no formatting decision.
The new regression failed before the change and passed afterward. All 54
comment formatting tests passed in a Windows build that reapplied this
change to LLVM 23.1.6.
Fixes #245606.
Assisted-by: OpenAI Codex. Draft for contributor review.
[Offload][Omp] Use olMemCpy3D in omp_target_memcpy_rect
Implement olMemCpyRect more generically in DeviceTy using the
accelerated olMemCy3D if supported by the device.
Use it to reimplement omp_target_memcpy_rect.
Assisted by Claude.
[Offload] Add olMemcpy3D API (#241959)
Add a new API that allows to copy 2D or 3D regions. Implement the
support for all the backends.
This API can be used to implement more efficitently
omp_target_memcpy_rect (see #241960)
or SYCL's sycl_ext_oneapi_memcpy2d.
Assisted by Claude.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[CIR] Lower constrained FP ops to typed LLVM dialect ops
Constrained FP ops were lowered to llvm.call_intrinsic with the intrinsic
name spelled as a string and the rounding mode, exception behavior and
fcmp predicate passed as metadata operands. The LLVM dialect has typed
ops for these intrinsics, which take the modes as enum attributes and
translate through IRBuilder::CreateConstrainedFPCall/CreateConstrainedFPCmp.
Use them: constrainedLLVMOp names the typed op in ODS (derived from
llvmOp where the names line up), whether it takes a rounding mode comes
from its RoundingModeOpInterface trait, and constrained fcmp reuses
convertCmpKindToFCmpPredicate. This removes the metadata helpers, the
predicate string tables and constrainedLLVMIntrinsicHasRoundingMode.
The LLVM IR now carries the strictfp call-site attribute on constrained
intrinsic calls, matching classic codegen.
Assisted-by: Claude Code (Opus 5.5).
tcp: count only the SACK blocks that fit in tcp_maxseg()
tcp_addoptions() sends only the SACK blocks that fit in TCP_MAXOLEN.
tcp_maxseg() counted every pending block and clamped the total, so
without timestamps and with five or more blocks pending it came out 4
bytes below the segment tcp_output() sends. Limited transmit after an
RTO then sent one full segment and failed the "sent too much" KASSERT.
PR: 282605
Approved by: adrian (mentor)
Signed-off-by: Nick Price <nprice at FreeBSD.org>
Reviewed by: tuexen, glebius, adrian
Differential Revision: https://reviews.freebsd.org/D60460
(cherry picked from commit d3b02115d4b373c719d9a716da38d94511de3f07)
[lld-macho] Collect S_ATTR_LIVE_SUPPORT sections with the markLive roots
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply at anthropic.com>
netipsec: Do not unlock the sahtree twice in ipsec6_common_input_cb()
For transport mode, ipsec6_common_input_cb() releases the sahtree read
lock before it walks the remaining header chain. The error exits of
that walk jumped to the bad label, which released the lock a second
time. A packet that exceeds net.inet6.ip6.hdrnestlimit, is truncated,
or fails the inbound policy check on its last header is enough to get
there.
The second rm_runlock() panics kernels with INVARIANTS. Without
INVARIANTS it unbalances td_pinned and removes a tracker that is no
longer queued, which may corrupt the per-CPU tracker list.
Give the header chain walk its own exit label that skips the unlock.
Reported by: llm-postcr
Reviewed by: markj, kib
Fixes: 183513d15f22 ("sys/netipsec: ensure sah stability...")
MFC after: 1 week
[2 lines not shown]
sysrc: Fix unlikely and rare edge-case
Fix 1 issue identified in post-commit review of eaf7113:
POSTCR-1.1: with -F, the "unchanged" check compares a file path
against the new value, so a value equal to the path is silently
not written
Add an ATF test to ensure we catch the edge-case possibility.
Special note: To replicate this misbehavior you'd have to do
something like: sysrc -f /etc/rc.conf foo=1 and then execute
sysrc -F -f /etc/rc.conf foo=/etc/rc.conf
Reported by: llm-postcr
Fixes: eaf7113bef8f ("sysrc: Add "unchanged" messages")
[clang][bytecode] Fix non-determinism diagnosing allocations. (#246151)
If there are multiple dynamic allocations, make sure we pick
consistently. Fixes failure on reverse-iteration bot
(https://lab.llvm.org/buildbot/#/builders/110).
[X86] canonicalizeShuffleWithOp - VZEXT_MOVL(LOGIC(X,Y)) ensure LOGIC uses integer type (#246469)
Missed in #245974 - VZEXT_MOVL nodes might have been used for fp-types,
so we must cast to an equivalent integer vector to perform the
and/or/xor op.
Fixes #246253
[analyzer][NFC] Avoid rebuilding full type ranges in the range inferrer (#246441)
SymbolicRangeInferrer::infer(QualType) built the full range of the type
for every symbol whose range was queried, and intersecting it with the
symbol's constraint built and uniqued another copy of the constraint.
Cache the full range set per integer type in RangeSet::Factory, and let
intersect return an operand directly when the other one is a single
range covering it.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) this
reduces the instructions of the static analyzer by 1.7-3.2%.
Assisted-by: Claude Opus 5.5
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[CIR] Lower constrained FP ops to typed LLVM dialect ops
Constrained FP ops were lowered to llvm.call_intrinsic with the intrinsic
name spelled as a string and the rounding mode, exception behavior and
fcmp predicate passed as metadata operands. The LLVM dialect has typed
ops for these intrinsics, which take the modes as enum attributes and
translate through IRBuilder::CreateConstrainedFPCall/CreateConstrainedFPCmp.
Use them: constrainedLLVMOp names the typed op in ODS (derived from
llvmOp where the names line up), whether it takes a rounding mode comes
from its RoundingModeOpInterface trait, and constrained fcmp reuses
convertCmpKindToFCmpPredicate. This removes the metadata helpers, the
predicate string tables and constrainedLLVMIntrinsicHasRoundingMode.
The LLVM IR now carries the strictfp call-site attribute on constrained
intrinsic calls, matching classic codegen.
Assisted-by: Claude Code (Opus 5.5).