[llubi] Add support for memcpy/memmove/memset (#245021)
This patch adds support for memcpy/memmove/memset libcalls. Unlike LLVM
intrinsics, passing null pointers or invalid pointers is UB, even if the
length is zero. Calling memcpy w/ equal src and dest pointers is also
UB.
Aided by DeepSeek-V4.1-Flash-1017.
[libc++][random] Implement LWG 3809 and LWG 4014 (#239844)
Summary:
- Implement LWG 3809 by correcting the seed initialization of
`std::subtract_with_carry_engine` for narrow result types.
- Implement LWG 4014 by reducing seed values modulo `2147483563` before
conversion to `uint_least32_t`, preserving the intended behavior for
wider result types.
- Add regression tests covering both defect reports.
Testing:
-
`libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/seed_result_type.pass.cpp`
[AMDGPU] Keep soft waitcnts unchanged until SIInsertWaitcnts converges
On the first visit to a loop header only the preheader state is known.
A soft waitcnt there (e.g. from a release fence) can have some of its
counters simplified away while another counter keeps the instruction
alive: the fence's own vmcnt(0), a preceding wait.asyncmark, or an
explicit s_waitcnt. The soft waitcnt was then rewritten with the
simplified value and promoted to a hard waitcnt, or merged into a
preceding hard one. When the back edge later brought a pending LDS
store, the original lgkmcnt(0) request was gone, and the s_barrier after
the release fence no longer waited for it.
Treat soft waitcnts as requests that depend on the incoming state: never
merge, promote or rewrite them while the analysis iterates. They are
kept unchanged in DeferredErasures, a hard waitcnt (existing or new)
carries what is needed on each visit, and the soft waitcnts are erased
once the analysis converges. This extends #220357, which did the same
only for soft waitcnts that were simplified away entirely.
[11 lines not shown]
Reland "[clang][CIR] Add tests for SVE RINT{N,P} intrinsics" (#244954)
This relands #241220 and #241236, which were reverted in #244680.
Since AArch64 call conv lowering, which is now the default since
#244014, doesn't have support for SVE, this does the migration with
`-fno-clangir-call-conv-lowering`, which allows these tests to avoid
call conv lowering.
hwpmc: claim stray PMI NMIs on Intel
core2_intr() claims an NMI only when IA_GLOBAL_STATUS shows an
overflow. It re-enables the LAPIC PMC vector before acking the
status bits, so a PMI raised while the handler runs can latch a
second NMI that finds the status already clear. That NMI goes
unclaimed and, with the default machdep.panic_on_nmi, panics the
machine. hwpmc_amd.c already absorbs such NMIs with a per-CPU
nmi_counter.
Give core2_intr() one credit per serviced PMI and spend it on the
next NMI on that CPU that finds no overflow.
Reproduced on a Xeon D-1518 (Broadwell-DE) running system-wide
CPU_CYCLES sampling: the unpatched kernel panicked with "NMI" after
about 47k PMIs. With this change it ran 12.5 hours (485k PMIs),
absorbed 6 empty NMIs, and did not panic.
Sponsored by: Netflix
[2 lines not shown]
www/opengist: Update to 1.16.0
Changes since 1.15.2:
v1.16.0
Security release
This release fixes 13 security vulnerabilities, please update as soon
as possible. Check the breaking changes and the steps after updating
below.
Added
* Gist comments (#855).
Security
* Unauthenticated writes to gists over Git HTTP
[89 lines not shown]
[LoopInterchange] Interchange loops by remapping induction variables
This is the main part of #235496. Before this patch, interchanging the
loops was achieved by splitting BBs and rewiring PHIs and branches.
This method is complicated and has caused several bugs. This patch
changes the way to achieve interchange so that the original CFG is kept
as it is. Instead of changing the control flow, this patch interchanges
the loops by using the counter of each loop to make it run as many
iterations as the other loop did, and by swapping IV-related variables
between the outer and inner loops. Also, in addition to simplifying the
logic, this approach doesn't create new BBs unlike the previous method,
so the generated IR is relatively clean.
The existing legality checks already rule out most of the loops to
which this transformation cannot be applied, so most of the changes are
confined to the transformation phase. The legality checks are changed
as follows:
- Loops where a branch before the inner loop depends on the outer IVs
[11 lines not shown]
Reapply "[LoopInterchange] Add tests for loop control values in the outer preheader (NFC)" (#235520)
This reverts commit 063d4816ce9051924a61f5d1e31a05992ca221b8.
Add test cases where it matters whether the loop control values (the
initial and final values of the IVs) are available in the outer loop
preheader. These are corner cases where the work in #235496 changes
what loop-interchange can handle.
The original commit was reverted because one of the tests failed with
EXPENSIVE_CHECKS due to stale SCEV dispositions (#221571). This has
been fixed by #222175 (not yet, but it will be). This reapply also adds
-verify-scev to the RUN line so that the issue is caught without
EXPENSIVE_CHECKS.
Part of #235496
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[LoopInterchange] Replace exit conditions of interchanged loops with counters
In the transformation phase of LoopInterchange, the exit condition of
the inner loop is reused by cloning the instructions involved in it and
moving them into a new BB. Handling all PHI nodes correctly in this way
is difficult, and it has caused several bugs.
Instead, this patch introduces a new way to control the interchanged
loops: add a new variable that works just as a loop counter, and compute
the exit condition from it and the original BTC. The induction variables
that were used only to compute the original exit conditions are deleted.
This makes the logic simpler, since the computation of the original exit
condition no longer needs to be moved.
Part of #235496
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[LoopInterchange] Require loop control values to be expandable in the outer preheader
This patch slightly changes the legality check in preparation for later
patches. Specifically:
- Loops whose inner IVs have initial values that are outer loop
invariant but neither constants nor instructions (e.g., function
arguments) become interchange candidates.
- Loops where the BTC of the inner loop is computed inside the outer
loop (more precisely, cannot be expanded in the outer loop preheader)
are no longer candidates.
As far as I tried, this change doesn't affect most cases.
Part of #235496
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[LoopUnroll] Drop poison-generating annotations on parallel reductions (#245038)
For min/max reductions we need to drop range attributes as well.
Fixes #245027.
[mlir][linalg][vector] Mark transfers in-bounds when no mask is needed (#244179)
Update `VectorizationState::maskOperation` to set `in_bounds` to `true`
when the vectorizer determines that no mask is required for an XFer
op because its accesses are guaranteed to be in-bounds.
This effectively reverses the change made in #160839.
Part of: https://github.com/llvm/llvm-project/issues/227821
Add a short delay when processing input to allow more input to arrive
and give greater opportunities for removing redundant output, can reduce
data volume a lot on fast output.