LLVM/project 659faeflldb/test/API/tools/lldb-dap/module TestDAP_module.py, lldb/tools/lldb-dap/Handler ModulesRequestHandler.cpp

[lldb-dap] Add paging into modules request (#222122)

Added support for modules paging according to [DAP
specification](https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Modules)
DeltaFile
+31-0lldb/test/API/tools/lldb-dap/module/TestDAP_module.py
+12-2lldb/tools/lldb-dap/Handler/ModulesRequestHandler.cpp
+43-22 files

LLVM/project 4318e7bllvm/lib/Transforms/InstCombine InstCombineCasts.cpp, llvm/test/Transforms/InstCombine uitofp.ll

Stop illegal interger type
DeltaFile
+52-0llvm/test/Transforms/InstCombine/uitofp.ll
+12-9llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+64-92 files

LLVM/project 7a92cd5llvm/include/llvm/CodeGen TargetLoweringObjectFileImpl.h, llvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp

[SystemZ][z/OS] Fix error "relative immediate relocation section mismatch"

Constants should go inside the text section, but this is not explicitly coded.
In the test case, the EH table is generated into a PR section. Then the
constant pool of function `fn_with_const_pool()` is emitted, which goes into
the PR section of the EH table insted of the code section. When the constant
is later referenced in the code, the relative offset cannot be calculated
because different sections are involved.
The fix is to explicitly return the text section for constants.
DeltaFile
+6-0llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+5-0llvm/test/CodeGen/SystemZ/zos-eh.ll
+3-0llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+14-03 files

LLVM/project 28d39b4llvm/lib/CodeGen MachineSink.cpp

CodeGen: Remove dead LiveVariables plumbing from MachineSink (#222563)

MachineSink threaded a LiveVariables pointer through to
SplitCriticalEdge so the analysis would be updated. It never used
LiveVariables for any decision, and MachineSinking runs before
LiveVariables in every pipeline.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+9-15llvm/lib/CodeGen/MachineSink.cpp
+9-151 files

LLVM/project 3c478e1llvm/lib/MC MCGOFFStreamer.cpp, llvm/test/CodeGen/SystemZ zos-eh.ll

[SystemZ][z/OS] Relax check for additional symbols in PR section (#222435)

The current check in `emitLabel()` is too strict. Inside a PR, there
cannot be no other external visible label. However, temporary labels
which are used e.g. for calculating offsets can be emitted. A situation
in which this occurs is the emission of the DWARF EH tables, in which a
temporary symbol (with an empty name) is emitted at the begin of the
table, causing an error message. This change limits the error to
non-temporary labels.
DeltaFile
+42-0llvm/test/CodeGen/SystemZ/zos-eh.ll
+1-1llvm/lib/MC/MCGOFFStreamer.cpp
+43-12 files

LLVM/project fb69e1dllvm/lib/Target/AMDGPU AMDGPUAttributor.cpp

AMDGPU: Query waves-per-EU and flat-wg range from subarch in attributor (#222596)

The maximum flat work group range is a pair of constants and the maximum
waves per execution unit is fully known from the subarch. Use TargetParser 
information and continue working to remove the dependence on  codegen.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+15-19llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+15-191 files

LLVM/project a774efblibcxx/include shared_mutex mutex, libcxx/test/libcxx/diagnostics unused_variables.verify.cpp

[libc++] Add [[gnu::warn_unused]] to a bunch of threading utilities (#213963)
DeltaFile
+53-0libcxx/test/libcxx/diagnostics/unused_variables.verify.cpp
+3-3libcxx/test/std/thread/thread.condition/thread.condition.condvarany/default.pass.cpp
+3-3libcxx/include/mutex
+2-2libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp
+2-2libcxx/include/shared_mutex
+1-1libcxx/test/libcxx/thread/nodiscard.verify.cpp
+64-115 files not shown
+69-1611 files

LLVM/project 148604autils/bazel/llvm-project-overlay/llvm BUILD.bazel

[bazel]Add missing utils/extract_symbols.py (#222653)

This was added in https://github.com/llvm/llvm-project/pull/221296
DeltaFile
+1-0utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+1-01 files

LLVM/project d7f2abdllvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution trip-count-unknown-stride.ll no-wrap-symbolic-becount.ll

[SCEV] Use the refined BE-count formula if the addition cannot overflow (#221227)

Generalize the logic added in
https://github.com/llvm/llvm-project/pull/218694
to consider AddingStrideMinusOneMayOverflow (was MayAddOverflow) instead
of just the !IVMayOverflow part.

This handles 2 additional cases when Start < RHS:
 * Stride is known power-of-2:
 * Start == Stride and Start == Stride -1.

The patch includes a mechanical change to move up the existing
MayAddOverflow with comments, and clarifies the name to
AddingStrideMinusOneMayOverflow.

This improves trip count computations in a number of real-world cases:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1195.

End-to-end Alive2 Proofs for both cases in unsigned:

    [2 lines not shown]
DeltaFile
+85-84llvm/lib/Analysis/ScalarEvolution.cpp
+4-4llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
+2-2llvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll
+91-903 files

LLVM/project da15729llvm/lib/Target/AArch64 AArch64FrameLowering.cpp, llvm/test/CodeGen/AArch64 sme2-intrinsics-vdot.ll sme2-intrinsics-int-dots.ll

[AArch64] Reorder ZPR stack spills to maximize ld1b/st1b pairings (#218950)

Currently, the stack allocation algorithm can order spilled ZPR
callee-saves in a way that prevents pairing.

Reorder ZPR callee-saves before frame indices are assigned to maximize
pairing opportunities. Pairing requires consecutive even/odd registers
at even stack offsets.
The remaining legality requirements are already checked when the
register pairs are formed.

The reordering algorithm primarily works by determining the parity of
the lowest ZPR spill offset. If the offset is odd, it places one
unpaired ZPR spill first so that subsequent register pairs begin at even
offsets.

Windows is not supported by this reordering algorithm for now, to keep
this change minimal.

New tests have been added to sve-callee-save-restore-pairs.ll to test
the reordering algorithm.
DeltaFile
+552-920llvm/test/CodeGen/AArch64/sme2-intrinsics-ldnt1.ll
+552-920llvm/test/CodeGen/AArch64/sme2-intrinsics-ld1.ll
+861-91llvm/test/CodeGen/AArch64/sve-callee-save-restore-pairs.ll
+88-120llvm/test/CodeGen/AArch64/sme2-intrinsics-int-dots.ll
+44-60llvm/test/CodeGen/AArch64/sme2-intrinsics-vdot.ll
+95-1llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+2,192-2,1123 files not shown
+2,222-2,1549 files

LLVM/project a10575dclang/lib/StaticAnalyzer/Core CallEvent.cpp

Rewrite addParameterValueToBindings to have less parameters.
DeltaFile
+5-11clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+5-111 files

LLVM/project 41fc4d5clang/docs ReleaseNotes.md, clang/lib/AST Decl.cpp

[Clang][Sema] Add fortify warnings for strlcpy (#221325)

Add `-Wfortify-source` diagnostics for `strlcpy` and `__builtin_strlcpy`
when the size argument exceeds the destination buffer size.

This is directly analogous to the previous PR for `strlcat` (#220341).

Also update `clang/test/Sema/warn-strlcpycat-size.c` and
`clang/test/Sema/builtins.c` to expect the `-Wfortify-source` warnings
where test calls pass sizes larger than the destination buffer capacity.

Part of #142230

Assisted-by: Gemini
DeltaFile
+6-3clang/test/Sema/warn-strlcpycat-size.c
+3-3clang/docs/ReleaseNotes.md
+6-0clang/test/Sema/warn-fortify-source.c
+3-2clang/test/Sema/builtins.c
+3-1clang/lib/Sema/SemaChecking.cpp
+3-0clang/lib/AST/Decl.cpp
+24-91 files not shown
+25-97 files

LLVM/project d6a9e68llvm/lib/Target/SystemZ/MCTargetDesc SystemZTargetStreamer.cpp, llvm/test/CodeGen/SystemZ zos-ppa1.ll zos-align-constpool.ll

x[SystemZ][z/OS] Correctly align the constant pool and the PPA1

Both should be half-word aligned. However, testing revealed that
both can end up on odd addresses, which leads to relocation errors.
Fix is to change the alignment.
DeltaFile
+20-0llvm/test/CodeGen/SystemZ/zos-align-constpool.ll
+2-2llvm/test/CodeGen/SystemZ/zos-ppa1.ll
+2-0llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.cpp
+24-23 files

LLVM/project 8be8161clang/include/clang/CodeGen ConstantInitBuilder.h, clang/lib/CodeGen ConstantInitBuilder.cpp

[clang][CodeGen] Stop overriding GlobalVariable's default address space (#222367)

The `GlobalVariable` constructor used by `createGlobal` receives a
`std::optional<unsigned> AddressSpace` that, when unspecified, falls
back to `M.getDataLayout().getDefaultGlobalsAddressSpace()`. However,
`createGlobal`'s `AddressSpace` arg was a bare `unsigned` defaulting to
0. By doing that, it was effectively overriding the `GlobalVariable`'s
constructor fallback with 0. On targets whose default globals address
space is not 0 (AMDGPU, SPIR/SPIR-V), this emitted
`@llvm.global_ctors/dtors` in address space 0 causing some issues (see
https://github.com/ROCm/SPIRV-LLVM-Translator/issues/293).
DeltaFile
+7-7clang/include/clang/CodeGen/ConstantInitBuilder.h
+4-7clang/lib/CodeGen/ConstantInitBuilder.cpp
+6-2clang/test/CodeGenCXX/constructor-attr.cpp
+2-2clang/test/OpenMP/amdgcn_target_global_constructor.cpp
+2-1clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
+21-195 files

LLVM/project 36fe08aclang/test/CIR/lib/Analysis CMakeLists.txt, mlir/test/lib/Analysis CMakeLists.txt

[MLIR][CIR][NFCI] Split TestAliasAnalysis into its own library (#222174)

This is a target for the CIR alias analysis, and bringing in all of the
MLIRTestAnalysis is too heavy: it results in a significant increase in
CIR test size. This patch, plus a few little things, gets us ~850 edges
removed from the Clang Build (after Medhi's patches).

This also has CIR use it.
DeltaFile
+20-1mlir/test/lib/Analysis/CMakeLists.txt
+1-1clang/test/CIR/lib/Analysis/CMakeLists.txt
+21-22 files

LLVM/project c363b39llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

[SLP] NFC: Remove redundant expression from getBuildVectorCost (#222547)

Gathers is initialized with the contents from VL and then not modified,
so `VL.equals(Gathers)` is always true.
DeltaFile
+3-6llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+3-61 files

LLVM/project c69a5eblibcxx/include/__utility declval.h

[libc++] Simplify the implementation of std::declval (#222303)

The implementation of `std::declval` calling `__declval` was originally
introduced for improved compile times. However, we now have a builtin
for `add_rvalue_reference`, which makes the old implementation faster
again, since we avoid instantiating any class types _and_ avoid overload
resolution.
DeltaFile
+4-8libcxx/include/__utility/declval.h
+4-81 files

LLVM/project 14789f7orc-rt/test/regression lit.cfg.py, orc-rt/test/regression/darwin check-rt-process-info.test

[orc-rt] Generalize testcases for different target archs (#222629)

Drop the hard-coded archs from the check-rt-process-info testcases.
Instead, check against an arch value derived from the build's target
triple.
DeltaFile
+3-3orc-rt/test/regression/darwin/check-rt-process-info.test
+3-2orc-rt/test/regression/linux/check-rt-process-info.test
+4-0orc-rt/test/regression/lit.cfg.py
+10-53 files

LLVM/project 3ec60e8libc/src/stdio/gpu vfprintf_utils.h

[libc] Optimize the GPU printf implementation with size hints (#222474)

Summary:
The GPU printf interface is functionally a shim to pass a `va_list` and
format string to the CPU for formatting. The size of the argument list
isn't exposed by the C ABI, but we can use `__builtin_object_size` to
try to look it up. This will bind to the `alloca` holding our arguments
in the ABI and return a positive size if it is known.

We do this opportunistically, as the check is lossy. In cases where it
is known, this saves a stack spill to store the true size. Additionally,
we can use this to detect cases where `printf` is being used as a simple
`puts`.

This saves 10 VGPRs for the `printf("string")` case. It also saves 8
bytes of stack in most all cases.
DeltaFile
+6-1libc/src/stdio/gpu/vfprintf_utils.h
+6-11 files

LLVM/project 30f6f86llvm/test/CodeGen/X86 min-legal-vector-width.ll inline-asm-pr76416.ll

RegisterPressure: Remove dead defs correctly

When an instruction has overlapping register defs where only some carry the
dead flag (for example a dead super-register def alongside a live sub-register
def), the collector left the shared register units in both the live and dead def
sets. That produced a PressureDiff decrement with no matching increment and tripped
the "PSet overflow/underflow" assertion in getUpwardPressureDelta.

A register unit is dead if any def covering it is dead, regardless of operand
order. Reconcile by subtracting the dead defs from the live defs instead of the
reverse: removeRegLanes only clears the overlapping units, so a def keeps any
units a dead def does not cover.

Fixes #155807.
Fixes #149144.
Fixes #76416.
Fixes #205272.

Co-authored-by: XChy <xxs_chy at outlook.com>
Co-authored-by: Claude claude-opus-4.8 <noreply at anthropic.com>
DeltaFile
+233-216llvm/test/CodeGen/X86/masked-udiv.ll
+106-89llvm/test/CodeGen/X86/vector-idiv-strictfp.ll
+72-60llvm/test/CodeGen/X86/vector-idiv-udiv-512.ll
+42-40llvm/test/CodeGen/X86/udiv_fix_sat.ll
+75-0llvm/test/CodeGen/X86/inline-asm-pr76416.ll
+35-35llvm/test/CodeGen/X86/min-legal-vector-width.ll
+563-4409 files not shown
+709-47215 files

LLVM/project 0afee5ccompiler-rt/lib/tsan/rtl tsan_interceptors_mac.cpp, compiler-rt/test/tsan/Darwin os_unfair_lock_deadlock.c trylock_no_deadlock.c

[Darwin][TSan] Use deadlock detector aware calls for Darwin-specific lock interceptors (#216040)

Currently the deadlock detector is unaware of these lock types because
the interceptors use bare Acquire-Release calls. This patch switches
them over to the Mutex(Pre|Post)Lock calls instead.

Assisted by: Claude

rdar://155410097
DeltaFile
+93-0compiler-rt/test/tsan/Darwin/trylock_no_deadlock.c
+39-0compiler-rt/test/tsan/Darwin/os_unfair_lock_deadlock.c
+16-11compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
+148-113 files

LLVM/project 21d80e8orc-rt/include/orc-rt-c/support Logging.h

[orc-rt] Remove redundant extern keyword. (#222619)

orc_rt_log_OSLogHandles is already extern via ORC_RT_C_EXPORT.
DeltaFile
+1-2orc-rt/include/orc-rt-c/support/Logging.h
+1-21 files

LLVM/project bf86a77offload/include device.h, offload/libompaccsupport device.cpp

[offload][omp] Move strict threads & groups computation to libomptarget
DeltaFile
+178-3offload/libompaccsupport/device.cpp
+0-147offload/plugins-nextgen/common/src/PluginInterface.cpp
+9-63offload/plugins-nextgen/common/include/PluginInterface.h
+40-1offload/include/device.h
+9-9offload/test/offloading/ompx_bare_gridsize.c
+1-1offload/test/offloading/ompx_bare_multi_dim.cpp
+237-2242 files not shown
+238-2278 files

LLVM/project b3eab3amlir/include/mlir/Dialect/LLVMIR LLVMIntrinsicOps.td, mlir/lib/Conversion/VectorToLLVM ConvertVectorToLLVM.cpp

[mlir][vector] Fix mask neutral value for masked fmaximum/fminimum reductions (#222275)

Masked maximumf/minimumf reductions were lowered by replacing inactive
lanes with a neutral value before applying an unmasked reduction. The
maximumf neutral was incorrectly set to the negative subnormal closest
to zero, causing it to beat any negative active value. Similarly,
minimumf used FLT_MAX, which loses to an active +Inf.
This change adds LLVM dialect support for
llvm.vp.reduce.fmaximum/fminimum and lowers masked reductions directly
to these predicated intrinsics.
DeltaFile
+84-62mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
+119-0mlir/test/Integration/Dialect/Vector/CPU/reductions-masked-minmax-f32.mlir
+64-8mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir
+8-0mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
+6-0mlir/test/Target/LLVMIR/Import/intrinsic.ll
+2-0mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+283-706 files

LLVM/project c61df43offload/include device.h, offload/libompaccsupport PluginManager.cpp

[offload][omp] Move reading _kernel_environment to libomptarget
DeltaFile
+57-64offload/plugins-nextgen/common/include/PluginInterface.h
+26-47offload/plugins-nextgen/common/src/PluginInterface.cpp
+66-0offload/libompaccsupport/PluginManager.cpp
+19-0offload/include/device.h
+9-2offload/plugins-nextgen/cuda/src/rtl.cpp
+0-6offload/plugins-nextgen/host/src/rtl.cpp
+177-1193 files not shown
+185-1209 files

LLVM/project 3eeb9b2flang/include/flang/Optimizer/Support AllocationPolicy.h, flang/include/flang/Optimizer/Transforms AllocationPlacementPolicy.h

[flang] add AllocationPolicy attribute to module and use it in InlineHLFIRCopy (#222013)

The StackArrays/AllocationPlacement pass cannot move fir.allocmem
created during InlineHLFIRCopy for the copy-in/cop-out buffers because
of there placement in branches.

Moving these allocmem outside of the branches is suboptimal as these
allocations may never occur at runtime (when the data is actually
already contiguous).
Extending the StackArrays pass is doable but very tedious (the data flow
analysis passes used in the pass cannot recognized "same
predicates"/understand that the two fir.if block that
allocate/deallocates will be both reached or never reached (even when
modifying InlineHLFIRCopy to use the same SSA value for both fir.if). So
this requires custom logic, and was adding 200 lines of non trivial code
to audit and I did not like it.

I decided to expose the allocation policy so that other passes can rely
on it. To make it the most flexible and future proof this is done via a

    [15 lines not shown]
DeltaFile
+146-0flang/include/flang/Optimizer/Support/AllocationPolicy.h
+130-0flang/test/HLFIR/inline-hlfir-copy-stack.fir
+119-0flang/lib/Optimizer/Support/AllocationPolicy.cpp
+102-16flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRCopy.cpp
+0-90flang/include/flang/Optimizer/Transforms/AllocationPlacementPolicy.h
+14-56flang/lib/Optimizer/Transforms/AllocationPlacement.cpp
+511-16218 files not shown
+766-20724 files

LLVM/project cb46e85llvm/lib/ExecutionEngine/JITLink ELF_riscv.cpp, llvm/test/ExecutionEngine/JITLink/RISCV ELF_relax_many_align.s

[JITLink][RISCV] Avoid quadratic removal of alignment edges (#222317)

We encountered this issue while using BOLT to instrument clang on
RISC-V. JITLink spent significant time removing alignment edges during
relaxation finalization in large code blocks with many alignment
relocations.

During RISC-V relaxation finalization, finalizeBlockRelax removes
AlignRelaxable edges individually from a block's edge vector. Each erase
shifts the remaining suffix, making this cleanup quadratic when the
number of alignment edges grows with the total edge count.

Compact surviving edges once and remove the trailing entries from the
back, preserving edge order and making cleanup linear. Count the
trailing entries before erasing to avoid comparing an invalidated
iterator.


These results support the performance benefit, but they come from

    [9 lines not shown]
DeltaFile
+29-0llvm/test/ExecutionEngine/JITLink/RISCV/ELF_relax_many_align.s
+9-6llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
+38-62 files

LLVM/project 46f9c22llvm/test/Transforms/Scalarizer bitcast-scalar-to-vector.ll bitcast-vector-to-scalar.ll

[Scalarizer] Update tests to use update_test_checks.py (#222460)

This PR is to address feedback on this comment:
https://github.com/llvm/llvm-project/pull/221033#discussion_r3973313815

requesting the tests use utils/update_test_checks.py instead.
DeltaFile
+24-18llvm/test/Transforms/Scalarizer/bitcast-vector-to-scalar.ll
+14-12llvm/test/Transforms/Scalarizer/bitcast-scalar-to-vector.ll
+38-302 files

LLVM/project cc45d4fllvm/test/Analysis/CostModel/X86 clmul.ll

[CostModel][X86] clmul.ll - add test coverage for vpclmulqdq targets (#222610)
DeltaFile
+48-23llvm/test/Analysis/CostModel/X86/clmul.ll
+48-231 files

LLVM/project 05d870boffload/include device.h, offload/libompaccsupport device.cpp

[offload][omp] Move strict threads & groups computation to libomptarget
DeltaFile
+177-3offload/libompaccsupport/device.cpp
+0-147offload/plugins-nextgen/common/src/PluginInterface.cpp
+7-63offload/plugins-nextgen/common/include/PluginInterface.h
+40-1offload/include/device.h
+9-9offload/test/offloading/ompx_bare_gridsize.c
+1-1offload/test/offloading/ompx_bare_multi_dim.cpp
+234-2242 files not shown
+235-2278 files