[libc++][pstl] Add one-liner implementations of std::remove_copy and std::remove_copy_if (#244161)
This PR implements PSTL versions of `std::remove_copy` and
`std::remove_copy_if` as one-liners in terms of `std::copy_if`.
`std::copy_if` will get a parallel implementation once #241966 is
merged, hence these 2 algorithms will be parallel as well.
Part of #99938.
[clang] Fix compile-time regression from variably modified type checks (#244352)
Follow-up to #229697, which caused a compile-time regression even on
code without VLAs.
Check `getCanonicalType()->isVariablyModifiedType()` in the callers
first, and push the context in `sizeof` only for variably modified
types. No functional change intended.
net-mgmt/pnp*: Fix build of the slave port
After 4851d7d, pnp-icinga2 could not build successfully, this
patch adds a standalone pkg-plist for slave port and excludes
a few sample nagios config files via NOSAMPLES=1 argument.
Also fixes user/group permissions of install command by emptying
MIX_OPTS that is used just like INSTALL_OPTS in master port.
PR: 279579
Approved by: no maintainer
[clang][CodeGen] Run Bypasses.Init() in StartFunction (#244723)
Move ShouldEmitLifetimeMarkers coroutine check and Bypasses.Init() from
CodeGenFunction::GenerateCode() into CodeGenFunction::StartFunction() so
non-FunctionDecl bodies (such as CapturedDecl, blocks, and ObjC methods)
also run bypass detection.
Add a regression test for CapturedDecl in
clang/test/CodeGen/trivial-auto-var-init-bypass.c.
Assisted-by: Gemini
[scudo] Zero free blocks for zero on deallocate. (#244447)
When enabling ZeroFill and zero on deallocate is configured, zero all
allocations in the free list.
Add a test to verify that those freed allocations are zeroed.
[Matrix] Implement matrix support for the `fmod` intrinsic (#244440)
Closes #184481.
This PR implements the matrix api for `fmod` and adds matrix codegen
tests and matrix sema tests. Matrix backend tests were not added because
no DirectX or SPIRV backend changes were made.
Assisted-by: Claude Opus 5.5
[AsmPrinter] Emit the data layout null value for null pointers
Currently `emitGlobalConstantImpl` emits a null pointer with `emitIntValue(0,
Size)`. This ignores the null value that the data layout can give an address
space (even though we have not reached the point where the ConstantPointerNull
can represent a real null pointer in certain address spaces), and `emitIntValue`
can only emit up to 8 bytes, so `llc` hits an assertion in `MCAsmStreamer` for a
null pointer of a wider address space in a global initializer, such as `ptr
addrspace(8) null` on AMDGPU. To be a little bit future proof, this PR emits the
null value of the data layout in the same way as an integer of the pointer size.
This PR was assisted by AI but I reviewed all the changes.
[AMDGPU] Pass the cast source to isKnownNonNull in lowerADDRSPACECAST
`lowerADDRSPACECAST` passes the cast node instead of its source to
`isKnownNonNull`. The cast node is never a frame index, a global address, or a
constant, so the check never succeeds, and SelectionDAG checks for null when it
casts an alloca or a global. At -O2 the `nonnull` flag that IR passes set on the
cast hides this, but at -O0 every such cast gets a compare and two selects. The
GlobalISel path already passes the source.
This PR was assisted by AI but I reviewed all the changes.
[libc] Add UB-free cpp::to_bitmask helper
Bit-casting a simd<bool, N> mask directly to its integer simd_bitmask
type reads padding bits as poison whenever N is not a multiple of
CHAR_BIT (for example, the scalar fallback N == 1).
Add cpp::to_bitmask to convert simd<bool, N> masks without reading
padding bits, and use it in shift_mask in inline_strlen.h.
Assisted-By: LLM
Reviewers: jhuber6, michaelrj-google
Pull Request: https://github.com/llvm/llvm-project/pull/244696
18764 printf should support alternate for %p
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
[VPlan] Use map_range with CastTo for cast-only range loops (NFC). (#244713)
Replace loops of the form
for (VPRecipeBase &R : VPBB->phis()) {
auto *PhiR = cast<VPPhi>(&R);
with
for (VPPhi &PhiR : map_range(VPBB->phis(), CastTo<VPPhi>)) {
and similarly for loops over users, so the cast is part of the range.
Also use the existing VPBlockUtils::blocksAs where applicable, and
make_isa_range instead of hand-written filter + cast combinations.
This is slightly more explicit and more compact.