LLVM/project 58e047e — llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination sadd-with-overflow.ll minmax.ll

[ConstraintElim] Split signed min/max across their operands when checking a compare

The existing constraint systems only record the bounds that hold for both
operands of a min/max (smax(a, b) >= a and >= b, smin(a, b) <= a and <= b). The
other direction is a disjunction, which cannot be recorded as a fact. When a
compare of signed decompositions involves a min/max result, split it into its
operands: the decomposition is monotonic in that result, so it is the max or min
of its values on each side, and the relation holds for all or for either side
respectively.

https://alive2.llvm.org/ce/z/zsGkJ-
DeltaFile
+366-3llvm/test/Transforms/ConstraintElimination/minmax.ll
+111-0llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+4-8llvm/test/Transforms/ConstraintElimination/sadd-with-overflow.ll
+481-113 files

LLVM/project fe35226 — llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination add-nsw.ll sadd-with-overflow.ll

[ConstraintElim] A signed sum of operands with opposite signs cannot wrap

If one operand is known non-negative and the other non-positive, the signed
sum is between them, so it cannot overflow.

https://alive2.llvm.org/ce/z/ZF5Yqr
DeltaFile
+97-2llvm/test/Transforms/ConstraintElimination/sadd-with-overflow.ll
+19-0llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+3-6llvm/test/Transforms/ConstraintElimination/add-nsw.ll
+119-83 files

LLVM/project 38f0173 — llvm/test/Transforms/ConstraintElimination ssub-with-overflow.ll

add ssub tests
DeltaFile
+100-0llvm/test/Transforms/ConstraintElimination/ssub-with-overflow.ll
+100-01 files

LLVM/project 36f2ae1 — llvm/lib/Transforms/Scalar ConstraintElimination.cpp

clang-format
DeltaFile
+1-2llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+1-21 files

LLVM/project 471bc59 — llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination sadd-with-overflow.ll

[ConstraintElim] Prove sadd/ssub.with.overflow cannot overflow from the exact sum

Decompose the operands and show that the sum lies in the range of the type. This
handles patterns like A + (B - A), as well as sums involving signed min/max
results, which are split across their respective operands using monotonicity
(for example start + smax(end - start - 1, 0) <= end).

https://alive2.llvm.org/ce/z/ze8LCk
DeltaFile
+539-0llvm/test/Transforms/ConstraintElimination/sadd-with-overflow.ll
+160-3llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+699-32 files

LLVM/project db62b96 — llvm/lib/Transforms/Scalar ConstraintElimination.cpp

adopt PR239379's WithCache<Value*> : public WithCache<const Value*>
DeltaFile
+10-20llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+10-201 files

LLVM/project 397caaf — llvm/lib/Transforms/Scalar ConstraintElimination.cpp

reuse known bits result with WithCache

The overloads feel like a bit of a hack, but we need them because ValueTracking
is much more strict about const than ConstraintElimination, and where we'd want
automatic conversion from WithCache<Value*>& to WithCache<const Value*>& we
can't even do it manually. See: https://github.com/llvm/llvm-project/pull/235158#discussion_r4449759101
DeltaFile
+23-12llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+23-121 files

LLVM/project 707655f — llvm/lib/Transforms/Scalar ConstraintElimination.cpp

don't add redundant facts
DeltaFile
+14-10llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+14-101 files

LLVM/project 0ec1137 — llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination transfer-samesign-facts.ll

add ConstraintInfo::isKnownNegative for symmetry
DeltaFile
+48-0llvm/test/Transforms/ConstraintElimination/transfer-samesign-facts.ll
+12-1llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+60-12 files

LLVM/project 6e224f5 — llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination transfer-samesign-facts.ll

[ConstraintElim] Propagate the sign across an icmp samesign

If one operand of `icmp samesign` is known (non-)negative, so is the other. Add
that as a fact in the signed system.

https://alive2.llvm.org/ce/z/xUgGRM
DeltaFile
+92-8llvm/test/Transforms/ConstraintElimination/transfer-samesign-facts.ll
+16-2llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+108-102 files

LLVM/project 7f048e2 — llvm/include/llvm/Analysis WithCache.h

clang-format
DeltaFile
+6-4llvm/include/llvm/Analysis/WithCache.h
+6-41 files

LLVM/project e35d05e — llvm/utils/lit/lit InprocBuiltins.py

[lit] Specify endianness in `int.to_byte` (#239388)

Complement to #239364. Adds on other non-default argument to
`int.to_bytes`, which are needed for Python versions <= 3.10.
DeltaFile
+1-1llvm/utils/lit/lit/InprocBuiltins.py
+1-11 files

LLVM/project 8dd8e63 — llvm/test/tools/llvm-diff compare-attributes.ll, llvm/tools/llvm-diff/lib DifferenceEngine.cpp

[llvm-diff] Compare function and call-site attributes (#238928)

Compare the function, return and parameter attributes and the calling
convention of the diffed functions, and of their call sites. Print the
attributes that are on only one side. This resolves the FIXMEs for
attributes and calling conventions.

AI-assisted.
DeltaFile
+97-0llvm/test/tools/llvm-diff/compare-attributes.ll
+53-5llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
+150-52 files

LLVM/project 7d9a3f9 — lldb/include/lldb/Core Module.h, lldb/source/Core Module.cpp

[lldb] Remove ConstString from Module::m_prefix_map_search_dirs (#238990)

Assisted-by: Claude
DeltaFile
+5-6lldb/source/Core/Module.cpp
+2-2lldb/include/lldb/Core/Module.h
+7-82 files

LLVM/project 65166e2 — llvm/include/llvm/IR RuntimeLibcalls.td

RuntimeLibcalls: Add signatures for size returning new and GPU profiling (#238642)

__size_returning_new and its variants return __sized_ptr_t, a pointer
and size pair. The GPU profiling functions use the compiler-rt
prototypes.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+8-6llvm/include/llvm/IR/RuntimeLibcalls.td
+8-61 files

LLVM/project ef2f08c — utils/bazel/llvm-project-overlay/mlir/unittests BUILD.bazel

[bazel] Add MLIR Remark tests to the Bazel overlay (#239340)
DeltaFile
+22-0utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel
+22-01 files

LLVM/project 03d3d83 — libc/src/__support/OSUtil/linux/syscall_wrappers shmget.h, libc/src/sys/shm shmget.h

[libc][sys/shm] Implement shmget syscall wrapper on Linux. (#239380)

`shmget` is a POSIX function (see
[docs](https://pubs.opengroup.org/onlinepubs/9799919799/functions/shmget.html#))
that returns a shared memory identifier created for a particular key.

On Linux, it can be implemented as a simple wrapper around `SYS_shmget`
syscall.

This is the first function from the newly added `<sys/shm.h>` header,
other functions / constants
will be added in the follow-up PRs.
DeltaFile
+39-0libc/test/src/sys/shm/linux/shmget_test.cpp
+35-0libc/src/__support/OSUtil/linux/syscall_wrappers/shmget.h
+34-0libc/src/sys/shm/linux/shmget.cpp
+27-0libc/src/sys/shm/shmget.h
+16-0libc/test/src/sys/shm/linux/CMakeLists.txt
+15-0libc/src/sys/shm/linux/CMakeLists.txt
+166-010 files not shown
+214-116 files

LLVM/project 2abfa10 — clang/docs ReleaseNotes.md, clang/lib/CodeGen MicrosoftCXXABI.cpp

[clang codegen] Fix MS ABI with deleted template constructor (#237634)

Under the Microsoft ABI, a class with a user-provided constructor cannot
be returned in a register. This check was fixed in 3ab4ae9e58c09 to also
handle template constructors. That fix missed a special case of the
special case: a deleted template constructor does not count as
user-provided.

Fixes #237188
DeltaFile
+7-6clang/lib/CodeGen/MicrosoftCXXABI.cpp
+13-0clang/test/CodeGen/arm64-microsoft-arguments.cpp
+5-0clang/docs/ReleaseNotes.md
+25-63 files

LLVM/project d7c9f3a — llvm/lib/CodeGen/GlobalISel Utils.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel urem.i32.ll combine-urem-pow-2.mir

[GlobalISel] Fold urem x, (shl pow2, y) to a mask (#238879)

Fixes #236466

This PR mirrors SelectionDAG's `OrZero` semantics to allow folding where
`d` is known to be a power of two or zero.

Prior to this, for a shift, `isKnownToBeAPowerOfTwo` only matched `1 <<
y` (which can only lose its bit where `y` is out of range, which is
poison), as shifting any other power of two may produce zero. Thus
`urem_pow2_to_mask` did not fire, and on AMDGPU GlobalISel fell back to
the full ~18 instruction division expansion whereas SelectionDAG
produces `x & (d - 1)`.

This patch adds an `OrZero` flag to `isKnownToBeAPowerOfTwo`, which now
recurses through `G_SHL`, `G_LSHR`, and `G_TRUNC` into the value being
shifted or truncated when said flag is set (or the result is known never
to be zero). The inclusion of `G_TRUNC` in this patch is necessary to
handle the `i64` case where `bypass-slow-division` truncates the

    [7 lines not shown]
DeltaFile
+19-367llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll
+188-4llvm/test/CodeGen/AMDGPU/GlobalISel/combine-urem-pow-2.mir
+6-51llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll
+34-5llvm/lib/CodeGen/GlobalISel/Utils.cpp
+22-0llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp
+22-0llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
+291-4275 files not shown
+307-45311 files

LLVM/project dbce6eb — llvm/test/CodeGen/ARM fpclamptosat_vec.ll vector-llrint.ll, llvm/test/CodeGen/Thumb2 mve-vecreduce-mlapred.ll mve-clmul.ll

[ARM] Enable SlotIndexes compaction by default (#238515)

Greedy measures live ranges in slot indexes, and the entries left by
instructions erased before allocation make some ranges look longer than
they are. Opt ARM into dropping those entries, as was done for AMDGPU,
so allocation reflects the code actually being allocated.

The test updates are register assignment and spill placement changes.
DeltaFile
+984-980llvm/test/CodeGen/Thumb2/mve-fptosi-sat-vector.ll
+818-816llvm/test/CodeGen/ARM/vector-lrint.ll
+712-715llvm/test/CodeGen/Thumb2/mve-clmul.ll
+655-655llvm/test/CodeGen/ARM/vector-llrint.ll
+628-629llvm/test/CodeGen/ARM/fpclamptosat_vec.ll
+587-591llvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll
+4,384-4,386143 files not shown
+14,010-14,028149 files

LLVM/project 7c582f0 — llvm/lib/Target/AMDGPU AMDGPUTargetTransformInfo.h AMDGPUTargetTransformInfo.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.h AMDGPUBaseInfo.cpp

move uniform helper
DeltaFile
+5-22llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+20-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+15-0llvm/test/Analysis/CostModel/AMDGPU/load.ll
+7-5llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+6-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+0-2llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+53-296 files

LLVM/project 7374c58 — llvm/lib/CodeGen/SelectionDAG SelectionDAGPrinter.cpp, llvm/test/CodeGen/X86 selectiondag-dot-opcode-metadata.ll

[SelectionDAG] Add opcode class metadata to DOT nodes (#228965)

SelectionDAG DOT graphs only expose printed node labels, so tools cannot
reliably distinguish SelectionDAG opcodes from machine opcodes.

Add `llvm_opcode` and `llvm_is_machine_opcode` attributes to each node
without changing the rendered graph. Add X86 coverage before and after
instruction selection.
DeltaFile
+58-0llvm/test/CodeGen/X86/selectiondag-dot-opcode-metadata.ll
+18-6llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+76-62 files

LLVM/project 4d47c2a — llvm/include/llvm/Analysis WithCache.h, llvm/unittests/Analysis CMakeLists.txt WithCacheTest.cpp

[Analysis] Allow WithCache<const T*> to bind by reference to WithCache<T*>. NFC

Much like how `T *` implicitly converts to `const T *`, we now allow the same
conversion when wrapped in a `WithCache<>`. To achieve this, `WithCache<T *>`
now derives from `WithCache<const T*>` so that a reference to the former may
bind to the latter while sharing the same cached KnownBits. Slicing across the
two types via a copy or assign is deleted, since that would duplicate the cache.

This should simplify adoption in passes like ConstraintElimination, where the
existing infrastructure within the pass uses `Value*` throughout, but the APIs
it calls in ValueTracking expect a `const Value *` by virtue of them taking a
`const WithCache<const Value *> &`.
DeltaFile
+48-0llvm/unittests/Analysis/WithCacheTest.cpp
+41-1llvm/include/llvm/Analysis/WithCache.h
+1-0llvm/unittests/Analysis/CMakeLists.txt
+90-13 files

LLVM/project 9c2de47 — llvm/utils/lit/lit InprocBuiltins.py

[lit] Also avoid match statement (#239373)

The match statement was added in Python 3.10 which is still newer than
what some builders have.
DeltaFile
+20-21llvm/utils/lit/lit/InprocBuiltins.py
+20-211 files

LLVM/project 127f19b — clang/lib/CIR/CodeGen CIRGenExprScalar.cpp CIRGenFixedPointBuilder.h, clang/test/CIR/CodeGen fixed-point-conversions.cpp fixed-point-arith.cpp

[CIR] Match classic codegen for saturating fixed-point negation and padded conversions

Three CIR fixed-point paths diverged from classic codegen. Unary minus on a
saturating fixed-point type emitted a plain subtraction instead of a
saturating 0 - x. With -fpadding-on-unsigned-fixed-point, float to unsigned
fixed-point conversion produced the fptosi.sat result in an unsigned CIR
type, so its clamp to 0 compared as unsigned and never fired; it now
converts and clamps in a signed type, like llvm::FixedPointBuilder, and
casts to the unsigned type afterwards. A saturating fixed-point conversion
that kept the width but changed signedness returned a value of the source
CIR type, which broke the cir.cmp verifier and needed a pointer bitcast to
store; it now casts to the destination type.

Assisted-by: Claude Code (Claude Opus 5.5).
DeltaFile
+86-0clang/test/CIR/CodeGen/fixed-point-arith.cpp
+11-12clang/lib/CIR/CodeGen/CIRGenFixedPointBuilder.h
+14-0clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+4-4clang/test/CIR/CodeGen/fixed-point-conversions.cpp
+115-164 files

LLVM/project b1cc685 — clang/include/clang/CIR/Dialect/Builder CIRBaseBuilder.h, clang/include/clang/CIR/Dialect/IR CIROps.td

[CIR] Store nsw/nuw as an OverflowFlags bit enum and split out saturated add/sub

cir.add, cir.sub and cir.mul carried nsw and nuw as two separate unit
properties, and lowering mapped them to LLVM with an early return that
picked nuw over nsw, so an op with both flags lowered to `overflow<nuw>`
and lost nsw. cir.add and cir.sub also carried a `sat` flag that changed
the operation's result rather than adding a poison condition.

Store the flags as one OverflowFlags bit-enum property, mapped flag by
flag onto mlir::LLVM::IntegerOverflowFlags in lowering so both survive.
The property uses the default EnumProp syntax with a space separator,
printed as `nuw`, `nsw` or `nuw nsw` as in LLVM IR, so no custom parser
or printer is needed. cir.mul now shares the add/sub base class and so
becomes Pure.

Saturating arithmetic moves to new cir.add.sat and cir.sub.sat ops, which
lower to the signed or unsigned saturation intrinsics by element type.
cir::OverflowBehavior and its operators go away; createAdd, createSub and
createMul take cir::OverflowFlags.

    [7 lines not shown]
DeltaFile
+62-44clang/include/clang/CIR/Dialect/IR/CIROps.td
+22-57clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+34-39clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+41-29clang/lib/CIR/CodeGen/CIRGenFixedPointBuilder.h
+62-0clang/test/CIR/IR/overflow-flags.cir
+47-5clang/test/CIR/CodeGen/fixed-point-arith.cpp
+268-17412 files not shown
+393-25318 files

LLVM/project 9f81d32 — libc/docs conf.py, libc/docs/dev building_docs.md

[libc][docs] Check entrypoints and filter stubs in docgen (#238908)

docgen previously checked for matching .cpp and *-macros.h files to mark
symbols as implemented.  That counted ENOSYS placeholder stubs as
complete while missing shared entrypoints, Clang freestanding headers,
and macros defined in hdrgen YAML or .h.def templates.

Check exported entrypoints.txt symbols scoped to each header (excluding
TODO stubs) for functions, and include hdrgen YAML, .h.def templates,
and freestanding headers for macros.  Point Furo View and Edit links on
generated pages to their docgen YAML definitions instead of build-tree
paths.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+173-46libc/utils/docgen/header.py
+77-0libc/utils/docgen/docgen_test.py
+13-17libc/utils/docgen/docgen.py
+25-1libc/docs/conf.py
+3-3libc/docs/dev/building_docs.md
+291-675 files

LLVM/project 6d525e6 —

[lit] Specify byte length (#239364)

The default of 1 was only added in Python 3.11.
DeltaFile
+0-00 files

LLVM/project db65bcb — llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/Transforms/Util/DeclareRuntimeLibcalls bsd.ll hexagon.ll

RuntimeLibcalls: Add signatures for the memcpy variants and __stack_smash_handler

The XCore and Hexagon memcpy variants take the usual destination,
source and size, except hexagon_memcpy_forward_vp4cp4n2 which takes a
word count. __stack_smash_handler uses the OpenBSD prototype.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+5-4llvm/include/llvm/IR/RuntimeLibcalls.td
+4-4llvm/test/Transforms/Util/DeclareRuntimeLibcalls/hexagon.ll
+1-1llvm/test/Transforms/Util/DeclareRuntimeLibcalls/bsd.ll
+10-93 files

LLVM/project be4f23e — llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/Transforms/Util/DeclareRuntimeLibcalls aarch64.ll

RuntimeLibcalls: Add signatures for the SME ABI support routines

Use the prototypes from the AArch64 SME ABI. __arm_sme_state returns two
64-bit values.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+40-40llvm/test/Transforms/Util/DeclareRuntimeLibcalls/aarch64.ll
+9-8llvm/include/llvm/IR/RuntimeLibcalls.td
+49-482 files