LLVM/project 9e0927d — libunwind/src UnwindCursor.hpp, libunwind/test signal_frame.pass.cpp

[libunwind] Clear the signal frame state after compact unwind steps (#232823)

`_isSignalFrame` was only updated by DWARF steps. After stepping out of a
signal frame (always DWARF, since compact unwind can't encode them; see
#186458), compact steps left it set, so later return addresses were
treated as exact IPs. Besides misreporting `unw_is_signal_frame`, this
looks up the wrong function's unwind info when a return address is the
start of the next function (e.g. if there was a noreturn call at the end
of a function). Clear the state on compact steps.

Assisted-by: Claude Opus 5.5
DeltaFile
+11-3libunwind/test/signal_frame.pass.cpp
+2-0libunwind/src/UnwindCursor.hpp
+13-32 files

LLVM/project e0a93cc — llvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp TargetLowering.cpp

[SelectionDAG] Add extension attributes in more places. (#232128)

- ubsantrap argument extension.
- atomic memset value argument extension.
- atomic memcopy/memmove/memset Size args passed as size_t.

Co-authored with IBM Bob.
DeltaFile
+100-0llvm/test/CodeGen/SystemZ/libcall-argext-atomic-mem-size.ll
+14-11llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+15-4llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+17-0llvm/test/CodeGen/SystemZ/libcall-argext-ubsantrap.ll
+11-5llvm/include/llvm/CodeGen/TargetLowering.h
+15-0llvm/test/CodeGen/SystemZ/libcall-argext-atomic-memset-value.ll
+172-203 files not shown
+178-259 files

LLVM/project 0dd0f36 — clang/test/Driver amdgpu-xnack-sramecc-flags.c

Apply suggestion from @chinmaydd
DeltaFile
+0-10clang/test/Driver/amdgpu-xnack-sramecc-flags.c
+0-101 files

LLVM/project d4599c5 — llvm/lib/LTO LTO.cpp, llvm/test/ThinLTO/X86 macho-guid-collision.ll

[ThinLTO] Record prevailing GUIDs by linker symbol name (#226911)

`LTO::addThinLTO` updates `GlobalResolutions` using the IR name from a
summary, but that map is keyed by mangled linker symbol names. On
Mach-O, the IR name `_foo` can therefore match the resolution for `foo`
(whose linker name is `_foo`). This assigns `_foo`'s GUID to `foo` and
can incorrectly internalize `foo` even when another module references
it, producing an undefined-symbol error.

Move the GUID assignment into the symbol loop, where `Sym.getName()`
identifies the correct resolution and the GUID has already been obtained
using `Sym.getIRName()`. Preserve the prevailing-definition check and
the existing fallback for bitcode without a GUID table.

This fixes a regression introduced by
39dcb0ff91b312bb269334168d5e32be78b60417 (#201849). It surfaced when
linking mimalloc 3.5.3 into a PGO/ThinLTO build of LLVM on macOS. The
standalone reproducer below needs only Clang, LLD, and the macOS SDK.


    [42 lines not shown]
DeltaFile
+41-0llvm/test/ThinLTO/X86/macho-guid-collision.ll
+1-5llvm/lib/LTO/LTO.cpp
+42-52 files

LLVM/project 11c0e7d — llvm/lib/Transforms/Utils LoopUtils.cpp, llvm/test/Transforms/LoopVectorize runtime-checks-hoist.ll

[LV] Don't emit duplicate negative stride runtime checks (#233132)

This speeds up x264 by 2.15% on RISC-V by avoiding a duplicate hoisted
runtime check.

When hoisting runtime checks we need to check that any strides are non
negative. But for a loop like

```c
for (int i = 0; i < m; i++)
  for (int j = 0; j < n; j++)
    dst[(i * stride1) + j] = src1[(i * stride2) + j] + src2[(i * stride2) + j];
```

We have the pairs [dst, src1] and [dst, src2]. Both pairs end up
checking that stride1 and stride2 are non-negative in IsConflict, and
because there's other values between the two checks in the chain of ors
InstCombine can't deduplicate it. This PR deduplicates the stride
checks.

    [90 lines not shown]
DeltaFile
+10-10llvm/test/Transforms/LoopVectorize/AArch64/low_trip_memcheck_cost.ll
+1-5llvm/test/Transforms/LoopVectorize/runtime-checks-hoist.ll
+3-2llvm/lib/Transforms/Utils/LoopUtils.cpp
+14-173 files

OpenZFS/src de9a1a8 — lib/libzfs libzfs_pool.c, module/zfs vdev_removal.c

vdev_removal: don't remove a mirror with a child still resilvering

The top-level DTLs of a mirror only contain ranges that are missing
from all of its children, so spa_vdev_remove_top_check() accepted the
removal of a mirror while one child was still waiting to be resilvered
or rebuilt (e.g. right after 'zpool attach' or 'zpool attach -s', or
after onlining a stale device with the resilver deferred or suspended).

The removal copy does not honour the children's DTLs: when the
destination is not a mirror the read is load-balanced across children
by vdev_mirror_child_select() with io_txg == 0, and for mirror
destinations the source child is chosen by index.  The copied data is
not checksum-verified, so stale data from the resilvering child was
silently written to the new location, and once the removal completed
the only good copy was gone, resulting in permanent data errors.

Refuse the removal with EBUSY while any writeable child has a
non-empty DTL_MISSING (vdev_resilver_needed()), as is already done for
'zpool split'.  This also covers a sequential rebuild, which keeps the

    [14 lines not shown]
DeltaFile
+15-0module/zfs/vdev_removal.c
+5-0tests/zfs-tests/tests/functional/removal/removal_with_errors.ksh
+2-1lib/libzfs/libzfs_pool.c
+22-13 files

OpenZFS/src 47d5d5f — tests/runfiles common.run, tests/zfs-tests/tests Makefile.am

ZTS: test removing a mirror while a child is resilvering

Add removal_with_resilver, which attaches a disk to a single-disk
top-level vdev with scan progress suspended, so the new mirror child is
still waiting to be resilvered, and checks that 'zpool remove' of that
mirror is refused.  It then lets the resilver finish, removes the mirror
and verifies the pool has no data errors.  It does this for a healing
resilver and for a sequential rebuild ('zpool attach -s').

This currently fails: the removal is accepted while the new child still
holds no data, and the removal copy can read the stale child, losing
data permanently.  The fix follows in the next commit.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Closes #19278
DeltaFile
+75-0tests/zfs-tests/tests/functional/removal/removal_with_resilver.ksh
+2-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+78-13 files

LLVM/project 3d78fba — clang/test/OpenMP declare_variant_construct_target.c, flang/test/Lower/OpenMP metadirective-construct.f90

[OpenMP] Fix construct context at TARGET and repeated-construct subsets

OMPContext has two bugs in how construct selectors are matched. Both can
select the wrong variant:

- The construct context should start at the innermost enclosing TARGET,
  but Clang and Flang add every enclosing construct. Inside a TARGET
  region nested in a PARALLEL, construct={parallel} matched the outer
  PARALLEL. OMPContext::addTrait now drops the constructs recorded before
  a target trait.
- A selector that only repeats a construct, such as
  construct={parallel do, parallel} over construct={parallel do}, adds no
  property. isStrictSubset required fewer properties, so a score tie
  between the two fell back to clause order. A shorter ordered construct
  sequence now also makes a strict subset. If the shorter selector has a
  user condition, or an ISA name the longer one lacks, the tie still falls
  back to clause order, since different conditions or ISA names share one
  property.


    [9 lines not shown]
DeltaFile
+163-0llvm/unittests/Frontend/OpenMPContextTest.cpp
+131-0flang/test/Lower/OpenMP/metadirective-construct.f90
+27-16llvm/lib/Frontend/OpenMP/OMPContext.cpp
+31-0clang/test/OpenMP/declare_variant_construct_target.c
+6-0llvm/include/llvm/Frontend/OpenMP/OMPContext.h
+358-165 files

LLVM/project 5ae449d — .github/workflows libc-fullbuild-tests.yml

[libc] Enable baremetal Armv7-M pre-merge tests

The tests are run using QEMU system emulation on AArch64 GitHub runners.

No strong reason to use AArch64 instead of x86_64 as it is via emulation
anyway. But AArch64 runners are cheaper, so that might prove beneficial.
DeltaFile
+2-2.github/workflows/libc-fullbuild-tests.yml
+2-21 files

LLVM/project c6e8eeb — libc/cmake/caches armv7m-none-eabi.cmake

[libc] Application and testing support in baremetal Armv7-M CMake cache file

This patch adds support for linking and running applications, including
tests, targeting baremetal Armv7-M to the corresponding CMake cache
file.

The cache file takes into consideration if compiler-rt is enabled or
not. If it is, then linking applications is possible, and the relevant
CMake variables are set to enable test runs. If not, then only the libc
build is possible and enabled.

Particular libc configuration options, memory mappings, and QEMU options
are based on what Arm Toolchain for Embedded uses in its fully working
downstream testing.
DeltaFile
+47-1libc/cmake/caches/armv7m-none-eabi.cmake
+47-11 files

LLVM/project 3a0e03f — .github/workflows/containers/libc Dockerfile

[libc] Add qemu-system-arm to libc Dockerfile for Arm baremetal testing

This patch adds `qemu-system-arm` to the packages installed into the
Docker image so that we can run Arm baremetal tests.

It is only installed on the AArch64 platforms because we intend to run
the tests on AArch64 GitHub runners. Therefore there is no need to
install on x86_64.
DeltaFile
+6-0.github/workflows/containers/libc/Dockerfile
+6-01 files

LLVM/project f84cc74 — flang/lib/Semantics canonicalize-omp.cpp, flang/test/Parser/OpenMP metadirective-dirspec.f90

Refactor, addressing review comments
DeltaFile
+70-47flang/lib/Semantics/canonicalize-omp.cpp
+55-0flang/test/Parser/OpenMP/metadirective-dirspec.f90
+125-472 files

LLVM/project 5db657b — clang/lib/Sema SemaOpenMP.cpp, clang/test/OpenMP flatten_codegen.cpp

[Clang][OpenMP] Convert `flatten` floating-point trip-count to integers  (#229458)

Fixes #225753

Solution: The compiler now turns that trip count into an integer before
it builds the flattened loop. The width follows the existing rule. If
the loop variable is an integer, the new count keeps that variable's
signedness, so a `long` loop with a `double` count stays signed.

If the conversion fails, `flatten` returns an error instead of aborting.
DeltaFile
+54-17clang/lib/Sema/SemaOpenMP.cpp
+32-0openmp/runtime/test/transform/flatten/floating-bounds.c
+28-0clang/test/OpenMP/flatten_codegen.cpp
+114-173 files

OpenZFS/src fbb554b — module/zfs vdev_removal.c

vdev_removal: don't hold ms_lock while cancel loads a space map

spa_vdev_remove_cancel_sync() is the last place that holds a
metaslab's ms_lock across space_map_load().  It can't deadlock the way
spa_vdev_remove_thread() and vdev_rebuild_thread() could: it runs as a
sync task, after every write of the syncing txg has completed, so no
write interrupt thread can be waiting there to free a block, and
nothing new is allocated on a vdev that is being removed.

Drop ms_lock around the read here as well, so that ms_lock is never
held across space map I/O, and ASSERT it as at the other call sites.
Without this the ASSERT fails in removal_cancel and
removal_with_errors, which cancel a removal.  In syncing context
nothing else changes the metaslab's space map, ms_freeing or unflushed
trees while the lock is dropped.

Reviewed-by: Matthew Ahrens <matt at mahrens.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Closes #19332
DeltaFile
+10-1module/zfs/vdev_removal.c
+10-11 files

LLVM/project 282188f — libc/src/__support/FPUtil CMakeLists.txt fp_bitwise.h, libc/test/src/__support/FPUtil CMakeLists.txt fp_bitwise_test.cpp

[libc] Add floating-point bitwise operations to FPUtil.

Add `fp_and`, `fp_or`, `fp_xor`, `fp_andnot`, and `fp_not` to
`src/__support/FPUtil/fp_bitwise.h` to perform bitwise operations on
floating-point values directly in FP/SIMD registers when SSE2 or AArch64 NEON
is available, avoiding GPR round-trips.

DeltaFile
+190-0libc/src/__support/FPUtil/fp_bitwise.h
+130-0libc/test/src/__support/FPUtil/fp_bitwise_test.cpp
+13-0utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+13-0libc/test/src/__support/FPUtil/CMakeLists.txt
+13-0libc/src/__support/FPUtil/CMakeLists.txt
+12-0utils/bazel/llvm-project-overlay/libc/test/src/__support/FPUtil/BUILD.bazel
+371-06 files

OpenZFS/src 6f0a3b6 — module/zfs vdev_rebuild.c

vdev_rebuild: don't hold ms_lock while loading a space map

vdev_rebuild_thread() reads each metaslab's space map while it holds
ms_sync_lock and ms_lock.  When the read hits an error, ZFS reads
another copy and then issues repair writes as children of the read, so
the read only completes after those writes complete in a write
interrupt taskq.  If a thread of that taskq is meanwhile freeing a
block in the same metaslab, it waits for ms_lock (metaslab_free() from
zio_free_sync() on all builds, and metaslab_check_free() on debug
builds), and nothing moves.  With two CPUs the write interrupt taskq
has a single thread, so this hangs the pool.  It is the same deadlock
as in device removal (previous commit).

It was reproduced with a test that is not included here, the device
removal reproducer adapted to a sequential resilver: a single write
interrupt thread (zio_taskq_write), metadata on two special vdevs with
read errors injected into one, a debug-only delay before each space
map read of the rebuild, and blocks in that metaslab overwritten and
synced during each delay, after "zpool attach -s" to the normal vdev.

    [16 lines not shown]
DeltaFile
+11-0module/zfs/vdev_rebuild.c
+11-01 files

OpenZFS/src 7f3b715 — module/zfs vdev_removal.c

vdev_removal: don't hold ms_lock while loading a space map

spa_vdev_remove_thread() reads each metaslab's space map while it holds
ms_sync_lock and ms_lock.  When the read hits an error, the mirror reads
another child and then issues repair writes as children of the read, so
the read only completes after those writes complete in a write
interrupt taskq.  If a thread of that taskq is meanwhile freeing a
block in the same metaslab, it waits for ms_lock (metaslab_check_free()
on debug builds, metaslab_free() through free_from_removing_vdev() on
all builds), and nothing moves.  With two CPUs the write interrupt
taskq has a single thread, so this hangs the pool.  676b7ef10 fixed the
same deadlock for svr_lock.

ZTS removal_with_errors injects read errors on one side of the mirror
it removes, and hung like this on the 2-CPU CI runners: z_wr_int
blocked in metaslab_check_free_impl(), spa_vdev_remove in zio_wait()
under space_map_load(), and txg_sync and "zpool remove" waiting for
them, until the job timed out.


    [21 lines not shown]
DeltaFile
+14-5module/zfs/vdev_removal.c
+14-51 files

LLVM/project 06d2ec9 — llvm/include/llvm/LTO/legacy ThinLTOCodeGenerator.h, llvm/lib/LTO LTOCodeGenerator.cpp

Legacy LTO: Set library options in LLVMContext (#233146)

llvm-lto and libLTO parse -mllvm style options with
cl::ParseCommandLineOptions, which sets library options in T::Global.
Since #233044, the LLVMContexts that LTOCodeGenerator and
ThinLTOCodeGenerator use read the defaults instead, so passes ignore
options like -vectorize-loops.

Parse the options into a cl::LibraryOptionsContext and switch to
cl::parseCommandLineOptions.

LLM-aided
DeltaFile
+38-0llvm/test/tools/lto/library-options.ll
+38-0llvm/test/LTO/X86/library-options.ll
+23-10llvm/tools/llvm-lto/llvm-lto.cpp
+20-11llvm/tools/lto/lto.cpp
+10-11llvm/lib/LTO/LTOCodeGenerator.cpp
+10-0llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+139-322 files not shown
+143-378 files

LLVM/project 53a4ef5 — lld/ELF ICF.cpp, lld/test/ELF icf-merge.s

[ELF] --icf: Compare same-symbol merge section references by offset (#233335)

```
.section .text.f1,"ax"
.quad .rodata.cst8
.section .text.f2,"ax"
.quad .rodata.cst8+8
.section .text.f3,"ax"
.quad .rodata.cst8+16
.section .text.f4,"ax"
.quad .rodata.cst8.1

.section .rodata.cst8,"aM",@progbits,8
.quad 42
.quad 42
.quad 43
.section .rodata.cst8.1,"aM",@progbits,8
.quad 42
```

    [5 lines not shown]
DeltaFile
+34-0lld/test/ELF/icf-merge.s
+2-5lld/ELF/ICF.cpp
+36-52 files

LLVM/project 48f71dd — lld/ELF ICF.cpp, lld/test/ELF icf-merge.s

[ELF] --icf: Fix crash on out-of-range merge section addend (#233295)

`getSymVA` validates a relocation referencing a merge section's
STT_SECTION symbol (#188677). ICF runs before getSymVA and its
`constantEq` calls getSectionPiece unchecked, leading to an invalid
`pieces[idx-1]` access in MergeInputSection::getParentOffset for an
out-of-range addend.

Treat such a reference (not seemed to generated by compilers) as unequal
to any other to fix the crash.
DeltaFile
+28-2lld/test/ELF/icf-merge.s
+14-5lld/ELF/ICF.cpp
+42-72 files

LLVM/project 92aa122 — llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Analysis/CostModel/AArch64 bsl.ll

[AArch64][TTI] Cost NEON Nots absorbed by And/Or users as free
DeltaFile
+7-9llvm/test/Analysis/CostModel/AArch64/bsl.ll
+14-2llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+21-112 files

LLVM/project 14cf592 — llvm/test/Analysis/CostModel/AArch64 bsl.ll

[AArch64][TTI] Add pre-commit tests (NFC)
DeltaFile
+85-2llvm/test/Analysis/CostModel/AArch64/bsl.ll
+85-21 files

LLVM/project 5cf1a06 — llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Analysis/CostModel/AArch64 bsl.ll

[AArch64][TTI] Cost the Ands of a NEON bit select as free

Or(And(M, A), And(Not(M), B)) selects to a single BSL/BIT/BIF. Charge the
Or and treat the single-use Ands in its block as free, using the matcher
shared with operand sinking.
DeltaFile
+8-8llvm/test/Analysis/CostModel/AArch64/bsl.ll
+10-0llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+18-82 files

LLVM/project 0310954 — llvm/test/Analysis/CostModel/AArch64 bsl.ll

[AArch64][TTI] Add pre-commit tests (NFC)
DeltaFile
+184-0llvm/test/Analysis/CostModel/AArch64/bsl.ll
+184-01 files

LLVM/project 7495abd — llvm/test/CodeGen/AArch64 aarch64-bit-gen.ll, llvm/test/Transforms/CodeGenPrepare/AArch64 sink-free-instructions.ll

[AArch64][TTI] Add pre-commit tests (NFC)
DeltaFile
+45-0llvm/test/CodeGen/AArch64/aarch64-bit-gen.ll
+35-0llvm/test/Transforms/CodeGenPrepare/AArch64/sink-free-instructions.ll
+80-02 files

LLVM/project f3dbfa4 — llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/CodeGen/AArch64 aarch64-bit-gen.ll

[AArch64][TTI] Drop single-use requirement on the mask from BSL sinking
DeltaFile
+6-7llvm/test/CodeGen/AArch64/aarch64-bit-gen.ll
+3-3llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+2-1llvm/test/Transforms/CodeGenPrepare/AArch64/sink-free-instructions.ll
+11-113 files

LLVM/project 13debda — clang/docs/CIR index.md

[CIR][Docs] Remove enabling MLIR explicitly in projects list (#233476)

Remove enabling MLIR explicitly in the `DLLVM_ENABLE_PROJECTS` when the
goal is to build ClangIR, because after #221739, it will be enabled
implicitly and linked with what ClangIR needs only.
DeltaFile
+1-1clang/docs/CIR/index.md
+1-11 files

LLVM/project 926c8bc — lldb/source/Plugins/SymbolLocator/SymStore SymbolLocatorSymStore.cpp, lldb/test/API/symstore TestSymStore.py

[lldb][SymStore] Abort cached file stream if request failed (#232848)

A continuation of #232038 to fix a crash when an HTTP request fails with
some data already received. The fix here is to abort the cached file
stream if the request fails.

The test uses the same responder as in the debuginfod test. I also
checked that it fails if we don't abort.
DeltaFile
+47-1lldb/test/API/symstore/TestSymStore.py
+1-0lldb/source/Plugins/SymbolLocator/SymStore/SymbolLocatorSymStore.cpp
+48-12 files

OpenZFS/src c09d94f — tests/runfiles common.run

ZTS: run mmap_sync_001_pos only from the Linux runfile

mmap_sync_001_pos appears in both common.run and linux.run, so the
default Linux suite executes it twice. The test requires Linux VM
tunables in /proc/sys/vm and skips other platforms.

Keep its registration in linux.run and remove the common.run entry.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19453
DeltaFile
+1-1tests/runfiles/common.run
+1-11 files

LLVM/project da9657b — clang/lib/CodeGen CodeGenFunction.h CGDebugInfo.h, clang/test/CodeGenCXX builtin-preserve-access-index.cpp

[Clang] Fix preserved C++ field indices (#226790)

Since 048493f88, preserved field accesses have used source field
ordinals
as debug-info indices. 4754814c5 accounted for omitted unnamed
bitfields,
but C++ debug info also contains bases, static members and vtable
pointers. For "struct S : Base { int x, y; }", the index for y therefore
identifies x. BPF CO-RE uses that index to select the field and its
offset.

Record each field's index while emitting its debug info and return it
with the record type. Complete the record and its bases for these
accesses: limited and constructor debug modes can otherwise leave only
forward declarations, without the layout needed for relocation.

Assisted-by: OpenAI Codex
DeltaFile
+75-0clang/test/CodeGenCXX/builtin-preserve-access-index.cpp
+13-33clang/lib/CodeGen/CGExpr.cpp
+17-5clang/lib/CodeGen/CGDebugInfo.cpp
+7-2clang/lib/CodeGen/CGDebugInfo.h
+2-2clang/test/DebugInfo/BPF/builtins-bpf-preserve-field-info-2.c
+0-3clang/lib/CodeGen/CodeGenFunction.h
+114-456 files