LLVM/project cf2b30alibc/utils/libctest format.py

[libc] Honor per-test timeout in lit test format (#193772)

The custom LibcTest format did not pass litConfig.maxIndividualTestTime
to executeCommand. This caused --timeout to be silently ignored, so
hanging tests like fdiv_test on AMDGPU blocked the entire suite until
the buildbot watchdog killed the process after 1200s.

Added timeout propagation and handling of ExecuteCommandTimeoutException
to return lit.Test.TIMEOUT. This follows the same pattern used by the
GoogleTest format in googletest.py.
DeltaFile
+14-5libc/utils/libctest/format.py
+14-51 files

LLVM/project 321db05llvm/test/CodeGen/AArch64 cpa-globalisel.ll popcount.ll, llvm/test/CodeGen/AArch64/GlobalISel localizer-arm64-tti.ll localizer-propagate-debug-loc.mir

Revert "[AArch64][GlobalISel] Do not run the Localizer at -O0 (#177359)" (#193781)

This reverts commit dur to one of the lldb-api tests failing.
DeltaFile
+177-239llvm/test/CodeGen/AArch64/GlobalISel/localizer-arm64-tti.ll
+79-87llvm/test/CodeGen/AArch64/cpa-globalisel.ll
+18-20llvm/test/CodeGen/AArch64/popcount.ll
+19-18llvm/test/CodeGen/AArch64/GlobalISel/localizer-propagate-debug-loc.mir
+11-11llvm/test/CodeGen/AArch64/GlobalISel/select-fp-anyext-crash.ll
+8-8llvm/test/CodeGen/AArch64/vararg.ll
+312-38319 files not shown
+365-43925 files

LLVM/project 7df5533libcxx/include algorithm, libcxx/include/__algorithm ranges_fold.h

[libc++] Implement `ranges::fold_left_first` and `ranges::fold_left_first_with_iter` (#180214)

- Part of #105208.
- Closes #174059.
- Closes #121558.

---------

Co-authored-by: JCGoran <jcgoran at protonmail.com>
Co-authored-by: A. Jiang <de34 at live.cn>
DeltaFile
+340-0libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left.pass.cpp
+0-340libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/left_folds.pass.cpp
+339-0libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left_first.pass.cpp
+61-0libcxx/include/__algorithm/ranges_fold.h
+21-0libcxx/include/algorithm
+15-4libcxx/test/benchmarks/algorithms/nonmodifying/fold.bench.cpp
+776-3445 files not shown
+792-34911 files

LLVM/project 023e2e6llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/AArch64 bswap-known-bits.ll

[DAGCombiner] Fold bswap of single-byte-known-nonzero value to a shift (#193473)

When computeKnownBits proves that a bswap operand has at most one byte
of possibly-nonzero bits at a known byte-aligned position, the bswap is
equivalent to a shift that moves that byte to the mirror position. This
is a producer-side known-bits rule; it fires in visitBSWAP regardless
of how the narrow-value provenance was established, covering shapes
such as
  bswap(and X, 0xFF)
  bswap(and X, 0xFF00)       ; all byte positions
  bswap(zext i8 X to iN)
  bswap(zext i16 X to i64)

Motivation. While investigating a RISCV codegen regression under
-combiner-topological-sorting (bswap-shift.ll), I traced the root cause
to the existing consumer-side rule in
TargetLowering::SimplifyDemandedBits
for ISD::BSWAP: when a consumer demands only one byte of the bswap
result, that rule rewrites the inner bswap as a shift. Under topological

    [33 lines not shown]
DeltaFile
+227-0llvm/test/CodeGen/RISCV/bswap-known-bits.ll
+150-4llvm/test/CodeGen/AArch64/bswap-known-bits.ll
+27-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+8-12llvm/test/CodeGen/X86/known-pow2.ll
+412-174 files

LLVM/project 1815df9llvm/lib/Target/SPIRV SPIRVEmitIntrinsics.cpp, llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_memory_access_aliasing alias-load-store-atomic.ll

[SPIRV] Do not add aliasing decorations to OpAtomicStore/OpAtomicLoad
DeltaFile
+6-19llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+4-9llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_memory_access_aliasing/alias-load-store-atomic.ll
+10-282 files

LLVM/project f782888llvm/test/CodeGen/X86 bitcnt-big-integer.ll bit-manip-i512.ll

[X86] Regenerate bit integer tests to show VPADD constant asm comments (#193763)
DeltaFile
+60-60llvm/test/CodeGen/X86/bitcnt-big-integer.ll
+9-9llvm/test/CodeGen/X86/bit-manip-i512.ll
+6-6llvm/test/CodeGen/X86/bit-manip-i256.ll
+75-753 files

LLVM/project d45d5b7llvm/test/CodeGen/SPIRV/transcoding store-atomic.ll load-atomic.ll

I forgot to update the tests
DeltaFile
+27-11llvm/test/CodeGen/SPIRV/transcoding/store-atomic.ll
+26-11llvm/test/CodeGen/SPIRV/transcoding/load-atomic.ll
+53-222 files

LLVM/project 602cc92llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/CodeGen/Hexagon safestack.ll

[Hexagon] Add SafeStack runtime libcall to HexagonSystemLibrary (#191673)

Register DefaultSafeStackGlobals for the Hexagon target so that the
SafeStack pass can locate the thread-local unsafe stack pointer during
codegen.

Without this, compiling with `-fsanitize=safe-stack` for Hexagon errors
with "no location available for safestack pointer address".
DeltaFile
+16-0llvm/test/CodeGen/Hexagon/safestack.ll
+2-1llvm/include/llvm/IR/RuntimeLibcalls.td
+18-12 files

LLVM/project d6ebdf4clang/include/clang/Analysis/Analyses/LifetimeSafety Loans.h

[NFC][Clang][Analyses] Fix AccessPath to have deleted copy assignment (#193639)

Static analysis flagged AccessPath because it had a copy constructor but
did not declare a copy assignment. It appears the intent is not to allow
assignment, so declare it deleted.
DeltaFile
+1-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+1-01 files

LLVM/project 37cd9adllvm/lib/Transforms/Instrumentation TypeSanitizer.cpp, llvm/test/Instrumentation/TypeSanitizer alloca-32bit.ll

[TySan] Fix size type mismatch in instrumentMemInst for 32-bit targets (#191601)

The outlined instrumentation path in instrumentMemInst passes Size
directly to the __tysan_instrument_mem_inst runtime call, which declares
its size parameter as uint64_t (i64). On 32-bit targets, Size is
IntptrTy (i32) for allocas and byval arguments, causing an assertion:

  Calling a function with a bad signature!

Add CreateZExtOrTrunc to widen Size to U64Ty before the call. This is a
no-op on 64-bit targets where IntptrTy is already i64.
DeltaFile
+39-0llvm/test/Instrumentation/TypeSanitizer/alloca-32bit.ll
+4-1llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
+43-12 files

LLVM/project 2d84862llvm/lib/CodeGen CodeGenPrepare.cpp, llvm/test/CodeGen/X86 indirect-br-gep-unmerge-flags.ll

[CodeGenPrepare] Drop nuw on gep unmerging if the new index is negative (#193488)

Fixes #193487.

Drop nuw if unmerging would result in gep with a negative index.
DeltaFile
+51-0llvm/test/CodeGen/X86/indirect-br-gep-unmerge-flags.ll
+11-7llvm/lib/CodeGen/CodeGenPrepare.cpp
+62-72 files

LLVM/project 98b3650llvm/test/CodeGen/AArch64 sve-intrinsics-matmul-bf16.ll sve-intrinsics-matmul-f16.ll

fixup! More small test fixes
DeltaFile
+1-3llvm/test/CodeGen/AArch64/sve-intrinsics-matmul-bf16.ll
+1-3llvm/test/CodeGen/AArch64/sve-intrinsics-matmul-f16.ll
+0-2llvm/test/CodeGen/AArch64/neon-matmul-f16f32mm.ll
+0-2llvm/test/CodeGen/AArch64/neon-matmul-f16.ll
+2-104 files

LLVM/project c201235clang/include/clang/Basic arm_neon.td, clang/lib/CodeGen/TargetBuiltins ARM.cpp

fixup! Address Kerry's PR comments
DeltaFile
+1-3clang/test/CodeGen/AArch64/v9.7a-neon-mmla-intrinsics.c
+2-2clang/include/clang/Basic/arm_neon.td
+1-2clang/utils/TableGen/NeonEmitter.cpp
+1-1clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_mmla-f16.c
+0-2clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+0-2llvm/test/CodeGen/AArch64/sve-bfmmla-bf16.ll
+5-122 files not shown
+6-158 files

LLVM/project 71c7f36llvm/test/CodeGen/AArch64 neon-matmul-f16.ll neon-matmul-f16f32mm.ll

fixup! Rename files to be more logical
DeltaFile
+15-0llvm/test/CodeGen/AArch64/neon-matmul-f16.ll
+15-0llvm/test/CodeGen/AArch64/neon-matmul-f16f32mm.ll
+0-15llvm/test/CodeGen/AArch64/aarch64-matmul-f16f32mm.ll
+0-15llvm/test/CodeGen/AArch64/aarch64-matmul-f16mm.ll
+0-14llvm/test/CodeGen/AArch64/sve-bfmmla-bf16.ll
+0-14llvm/test/CodeGen/AArch64/sve-fmmla-f16.ll
+30-582 files not shown
+58-588 files

LLVM/project a62e766clang/test/CodeGen/AArch64 v9.7a-neon-mmla-intrinsics.c, clang/test/CodeGen/AArch64/sve-intrinsics acle_sve_mmla-bf16.c acle_sve_mmla-f16.c

[AArch64][clang][llvm] Add ACLE Armv9.7 MMLA intrinsics

Implement new ACLE matrix multiply-accumulate intrinsics for Armv9.7:

```c
  // 16-bit floating-point matrix multiply-accumulate.
  // Only if __ARM_FEATURE_SVE_B16MM
  // Variant also available for _f16 if (__ARM_FEATURE_SVE2p2 && __ARM_FEATURE_F16MM).
  svbfloat16_t svmmla[_bf16](svbfloat16_t zda, svbfloat16_t zn, svbfloat16_t zm);

  // Half-precision matrix multiply accumulating to single-precision
  // instruction from Armv9.7-A. Requires the +f16f32mm architecture extension.
  float32x4_t vmmlaq_f32_f16(float32x4_t r, float16x8_t a, float16x8_t b)

  // Non-widening half-precision matrix multiply instruction. Requires the
  // +f16mm architecture extension.
  float16x8_t vmmlaq_f16_f16(float16x8_t r, float16x8_t a, float16x8_t b)
```
DeltaFile
+47-0clang/test/CodeGen/AArch64/v9.7a-neon-mmla-intrinsics.c
+32-0clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_mmla-bf16.c
+32-0clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_mmla-f16.c
+32-0clang/test/Sema/AArch64/arm_sve_non_streaming_only_sve_AND_sve-b16mm.c
+32-0clang/test/Sema/AArch64/arm_sve_non_streaming_only_sve_AND_sve2p2_AND_f16mm.c
+16-0llvm/test/CodeGen/AArch64/sve-fmmla-f16.ll
+191-014 files not shown
+297-1220 files

LLVM/project 183168allvm/lib/Frontend/Atomic Atomic.cpp, mlir/test/Target/LLVMIR openmp-llvm.mlir

[OpenMP][OMPIRBuilder] Convert cmpxchg memory order to C ABI constants (#193536)

`EmitAtomicCompareExchangeLibcall` passed LLVM AtomicOrdering enum
values directly as the success/failure ordering arguments to
`__atomic_compare_exchange`. However, the C ABI expects the `__ATOMIC_*`
constants instead.

`EmitAtomicLoadLibcall` and `EmitAtomicStoreLibcall` already use
`toCABI()` for this conversion. Apply the same conversion in
`EmitAtomicCompareExchangeLibcall`.

This PR is a reland of #191857 which was closed incorrectly due to
parent branch deleted.
DeltaFile
+24-4mlir/test/Target/LLVMIR/openmp-llvm.mlir
+4-2llvm/lib/Frontend/Atomic/Atomic.cpp
+28-62 files

LLVM/project a54364allvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/X86 combine-bswap.ll

[DAGCombine] Relax restriction on (bswap shl(x,c)) combine (#193679)

We can still do the
(bswap shl(x,c)) -> (zext(bswap(trunc(shl(x,sub(c,bw/2))))))
combine if the shift amount is a multiple of 8 not just 16.

https://alive2.llvm.org/ce/z/crnSB6
DeltaFile
+20-0llvm/test/CodeGen/X86/combine-bswap.ll
+2-3llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+22-32 files

LLVM/project ef82b67llvm/lib/Target/RISCV RISCVCallingConv.cpp

[RISCV] Pass Subtarget to CC_RISCVAssign2XLen. NFC (#193609)

Previously we passed XLen and EABI, but still needed to get something
else from Subtarget so we looked it up from State. Instead, just pass
Subtarget and query all the information from it.
DeltaFile
+10-8llvm/lib/Target/RISCV/RISCVCallingConv.cpp
+10-81 files

LLVM/project f99880elibc/test CMakeLists.txt

[libc][NFC] Fix typo in GPU test warning message (#193762)

The warning referred to CMAKE_CROSS_COMPILING_EMULATOR (with an extra
underscore) instead of CMAKE_CROSSCOMPILING_EMULATOR.
DeltaFile
+1-1libc/test/CMakeLists.txt
+1-11 files

LLVM/project 14daadclldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.cpp ProcessGDBRemote.h

[lldb] Override UpdateBreakpointSites in ProcessGDBRemote to use MultiBreakpoint

This concludes the implementation of MultiBreakpoint by actually using
the new packet to batch breakpoint requests.

https://github.com/llvm/llvm-project/pull/192910
DeltaFile
+190-0lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+8-0lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+198-02 files

LLVM/project bfa1883llvm/lib/Target/SPIRV SPIRVEmitIntrinsics.cpp

Update llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Co-authored-by: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
DeltaFile
+0-1llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+0-11 files

LLVM/project 91b0fbcllvm/lib/Target/X86 X86ISelLowering.cpp

[X86] Use getTargetVShiftByConstNode helper to reduce code duplication. NFCI. (#193736)

Cleanup getTargetVShiftByConstNode and use it instead of repeatedly handling bitcasts/shift amount creation.
DeltaFile
+20-32llvm/lib/Target/X86/X86ISelLowering.cpp
+20-321 files

LLVM/project f19f3cdllvm/lib/Target/AMDGPU AMDGPUMCResourceInfo.cpp

[NFC][AMDGPU] Make code consistent in MCResourceInfo::gatherResourceInfo (#193735)

Some of the enums have the type name but some don't.
DeltaFile
+5-6llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
+5-61 files

LLVM/project 35a2784lldb/include/lldb/Target Process.h, lldb/source/Plugins/Process/Utility StopInfoMachException.cpp

[lldb] Implement delayed breakpoints

This patch changes the Process class so that it delays *physically*
enabling/disabling breakpoints until the process is about to
resume/detach/be destroyed, potentially reducing the packets transmitted
by batching all breakpoints together.

Most classes only need to know whether a breakpoint is "logically"
enabled, as opposed to "physically" enabled (i.e. the remote server has
actually enabled the breakpoint). However, lower level classes like
derived Process classes, or StopInfo may actually need to know whether
the breakpoint was physically enabled. As such, this commit also adds a
"IsPhysicallyEnabled" API.

https://github.com/llvm/llvm-project/pull/192910
DeltaFile
+95-8lldb/source/Target/Process.cpp
+30-1lldb/include/lldb/Target/Process.h
+6-6lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+5-3lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
+4-2lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
+5-0lldb/source/Target/TargetProperties.td
+145-203 files not shown
+149-249 files

LLVM/project a829194mlir/lib/Dialect/Vector/Transforms VectorDropLeadUnitDim.cpp, mlir/test/Dialect/Vector vector-dropleadunitdim-transforms.mlir

[mlir][vector] Generalize castAwayContractionLeadingOneDim (#187312)

This PR generalizes castAwayContractionLeadingOneDim to allow
accumulators with rank 1 to be matched.
With this generalization we allow the following contractions:

```
          %c = vector.contract {
               indexing_maps = [
                    affine_map<(d0, d1) -> (d0)>,
                    affine_map<(d0, d1) -> (d1, d0)>,
                    affine_map<(d0, d1) -> (d1)>],
               iterator_types = ["reduction", "parallel"],
               kind = #vector.kind<add>
               } %0, %1, %2 : vector<64xf32>, vector<1x64xf32> into vector<1xf32>
```

to be matched and transformed to 


    [36 lines not shown]
DeltaFile
+19-0mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir
+1-1mlir/lib/Dialect/Vector/Transforms/VectorDropLeadUnitDim.cpp
+20-12 files

LLVM/project e180c10lldb/include/lldb/Breakpoint BreakpointSite.h, lldb/include/lldb/Target Process.h

[lldb][NFC] Move BreakpointSite::IsEnabled/SetEnabled into Process

The Process class is the one responsible for managing the state of a
BreakpointSite inside the process. As such, it should be the one
answering questions about the state of the site.

https://github.com/llvm/llvm-project/pull/192910
DeltaFile
+23-29lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+16-7lldb/source/Target/Process.cpp
+6-14lldb/include/lldb/Breakpoint/BreakpointSite.h
+10-0lldb/include/lldb/Target/Process.h
+5-5lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+8-0lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+68-555 files not shown
+76-6411 files

LLVM/project 187a169lldb/source/Plugins/Process/gdb-remote GDBRemoteCommunicationClient.cpp GDBRemoteCommunicationClient.h, lldb/unittests/Process/gdb-remote GDBRemoteCommunicationClientTest.cpp

[lldb][GDBRemote] Parse MultiBreakpoint+ capability
DeltaFile
+22-0lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+10-0lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+3-0lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+35-03 files

LLVM/project bced9f7llvm/lib/Transforms/Scalar MergeICmps.cpp, llvm/test/Transforms/MergeICmps/X86 wrong-signature.ll

[MergeICmps] Check for libfunc emittability (#193764)

Fixes https://github.com/llvm/llvm-project/issues/192017.
DeltaFile
+42-0llvm/test/Transforms/MergeICmps/X86/wrong-signature.ll
+2-2llvm/lib/Transforms/Scalar/MergeICmps.cpp
+44-22 files

LLVM/project a47c0aelldb/include/lldb/Utility StringExtractorGDBRemote.h, lldb/packages/Python/lldbsuite/test/tools/lldb-server gdbremote_testcase.py

[lldb-server] Implement support for MultiBreakpoint packet

This is fairly straightforward, thanks to the helper functions created
in the previous commit.

https://github.com/llvm/llvm-project/pull/192910
DeltaFile
+57-0lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+2-0lldb/source/Utility/StringExtractorGDBRemote.cpp
+2-0lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
+1-0lldb/include/lldb/Utility/StringExtractorGDBRemote.h
+0-1lldb/test/API/functionalities/multi-breakpoint/TestMultiBreakpoint.py
+1-0lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+63-16 files

LLVM/project 7d292a5lldb/source/Plugins/Process/gdb-remote GDBRemoteCommunicationServerLLGS.cpp GDBRemoteCommunicationServerLLGS.h

[lldb-server][NFC] Factor out code handling breakpoint packets

This commit extracts the code handling breakpoint packets into a helper
function that can be used by a future implementation of the
MultiBreakpointPacket.

It is meant to be purely NFC.

There are two functions handling breakpoint packets (`handle_Z`
and `handle_z`) with a lot of repeated code. This commit did not attempt
to merge the two, as that would make the diff much larger due to subtle
differences in the error message produced by the two. The only
deduplication done is in the code processing a GDBStoppointType, where a
helper struct (`BreakpointKind`) and function (`std::optional<BreakpointKind> getBreakpointKind(GDBStoppointType stoppoint_type)`) was created.

https://github.com/llvm/llvm-project/pull/192910
DeltaFile
+147-105lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+28-0lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
+175-1052 files