LLVM/project 223ef1fclang/test/CodeGen builtins-nvptx-native-half-type.c promoted-complex-div.c, llvm/lib/IR IRBuilder.cpp

[IRBuilder] ConstFold unary intrinsics (#200496)

Extend TargetFolder and InstSimplifyFolder to fold unary intrinsics.
CreateUnaryIntrinsic now returns a Value, similar to
CreateBinaryIntrinsic, and this has necessitated more changes.
DeltaFile
+8-6llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+8-5llvm/lib/IR/IRBuilder.cpp
+1-10llvm/test/Transforms/SLPVectorizer/X86/revec-reduced-value-vectorized-later.ll
+7-4llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+5-5clang/test/CodeGen/builtins-nvptx-native-half-type.c
+8-2clang/test/CodeGen/promoted-complex-div.c
+37-3232 files not shown
+116-10138 files

LLVM/project 8d5d550llvm/lib/Transforms/Vectorize VPlanUtils.h VPlanPatternMatch.h

[VPlan] Factor vputils::getIntrinsicID (NFC) (#200174)

In preparation to get getOpcodeOrIntrinsicID used by CSE to handle calls
and to constant-fold intrinsic calls, factor out vputils::getIntrinsicID
from VPlanPatternMatch to re-use.
DeltaFile
+24-22llvm/lib/Transforms/Vectorize/VPlanUtils.h
+19-21llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
+10-10llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+7-7llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+4-5llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+4-5llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+68-706 files

LLVM/project 3f673f7clang-tools-extra/clang-tidy/modernize UseRangesCheck.cpp, clang-tools-extra/clang-tidy/utils UseRangesCheck.cpp UseRangesCheck.h

[clang-tidy] `use-ranges`: preserve used unique results

Preserve iterator uses when replacing std::unique with std::ranges::unique by appending .begin() in used-result contexts.

Fix #127658

Assisted by Codex.
DeltaFile
+41-0clang-tools-extra/clang-tidy/utils/UseRangesCheck.cpp
+30-9clang-tools-extra/clang-tidy/modernize/UseRangesCheck.cpp
+31-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-ranges.cpp
+14-0clang-tools-extra/clang-tidy/utils/UseRangesCheck.h
+7-0clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/use-ranges/fake_std.h
+6-0clang-tools-extra/docs/ReleaseNotes.rst
+129-91 files not shown
+131-97 files

LLVM/project ea7a200clang-tools-extra/clang-tidy/modernize UseRangesCheck.cpp, clang-tools-extra/clang-tidy/utils UseRangesCheck.cpp UseRangesCheck.h

[clang-tidy] `use-ranges`: avoid unsafe result fix-its

Preserve callable results with .fun, allow structured-binding-safe rewrites, and keep diagnostics while suppressing unsafe fix-its when ranges result objects do not match the original result shape.

Assisted by Codex.
DeltaFile
+38-2clang-tools-extra/clang-tidy/utils/UseRangesCheck.cpp
+37-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-ranges.cpp
+22-5clang-tools-extra/clang-tidy/modernize/UseRangesCheck.cpp
+26-0clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/use-ranges/fake_std.h
+7-0clang-tools-extra/docs/ReleaseNotes.rst
+2-0clang-tools-extra/clang-tidy/utils/UseRangesCheck.h
+132-71 files not shown
+134-77 files

LLVM/project da0f0b3clang-tools-extra/clang-tidy/modernize UseRangesCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] `use-ranges`: preserve remove iterator results

Preserve used iterator results for remove, partition, stable_partition, and rotate-style replacements by appending .begin() where the ranges algorithm returns a subrange.

Fix #124794

Assisted by Codex.
DeltaFile
+25-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-ranges.cpp
+16-0clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/use-ranges/fake_std.h
+6-6clang-tools-extra/clang-tidy/modernize/UseRangesCheck.cpp
+4-0clang-tools-extra/docs/ReleaseNotes.rst
+51-64 files

LLVM/project 9afac79clang-tools-extra/clang-tidy/modernize UseRangesCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] `use-ranges`: preserve output results

Preserve used output iterator results for output algorithm replacements by appending .out where the ranges algorithm returns an algorithm result object.

Fix #110223

Assisted by Codex.
DeltaFile
+104-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-ranges.cpp
+59-0clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/use-ranges/fake_std.h
+26-28clang-tools-extra/clang-tidy/modernize/UseRangesCheck.cpp
+3-0clang-tools-extra/docs/ReleaseNotes.rst
+2-0clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst
+194-285 files

LLVM/project 42d712ellvm/lib/Target/X86 X86TargetTransformInfo.cpp, llvm/test/Transforms/LoopVectorize/X86 vector_max_bandwidth.ll

[X86][TTI] Use dyn_cast_or_null in getGSVectorCost. (#200606)

Ptr may be nullptr, use dyn_cast_or_null to fix crash.

Fixes https://github.com/llvm/llvm-project/issues/200330.
DeltaFile
+24-0llvm/test/Transforms/LoopVectorize/X86/vector_max_bandwidth.ll
+1-1llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+25-12 files

LLVM/project 6d2a90bllvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-shuffle-combining-avx512vbmi2.ll

[X86] matchBinaryPermuteShuffle - match to X86ISD::SHLD funnel shift patterns (REAPPLIED) (#200604)

Add matchShuffleAsVSHLD helper to recognise shuffle masks that can fold
to funnel shifts

Reapplied with fix for shift amount not being appropriately scaled -
test case added at #200569

Fixes #145276
DeltaFile
+46-0llvm/lib/Target/X86/X86ISelLowering.cpp
+16-18llvm/test/CodeGen/X86/vector-shuffle-combining-avx512vbmi2.ll
+62-182 files

LLVM/project 1f10f1cllvm/include/llvm/ADT DenseMap.h, llvm/lib/IR Value.cpp

[DenseMap] Replace tombstone deletion with TAOCP 6.4 Algorithm R (#200595)

DenseMap uses quadratic probing with lazy deletion: an erased entry
becomes a tombstone, a third bucket state alongside empty and live that
every find/insert must inspect.

Switch to linear probing with backward-shift deletion (Knuth TAOCP 6.4
Algorithm R), similar to the SmallPtrSet change #197637. This removes
the tombstone state entirely.

In exchange, erase now relocates the following live entries to close the
hole, so it invalidates iterators and references other than the erased
one. For callers that cache pointers into the bucket array,
erase(Key, OnMoved) and erase(iterator, OnMoved) fire a callback once
per
shifted bucket, so fix-ups cost O(cluster) rather than O(NumEntries).
ValueHandleBase::RemoveFromUseList uses this to refresh each moved
handle's PrevPtr.


    [17 lines not shown]
DeltaFile
+91-119llvm/include/llvm/ADT/DenseMap.h
+4-1llvm/lib/IR/Value.cpp
+1-2llvm/unittests/ADT/BitVectorTest.cpp
+96-1223 files

LLVM/project 9077984llvm/lib/Transforms/Utils LowerInvoke.cpp, llvm/test/Transforms/LowerInvoke lowerinvoke.ll

[LowerInvoke] Use createCallMatchingInvoke instead of rolling it ourselves (#200536)

Using createCallMatchingInvoke ensures we copy metadata from the invoke
onto the call.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
DeltaFile
+21-0llvm/test/Transforms/LowerInvoke/lowerinvoke.ll
+3-11llvm/lib/Transforms/Utils/LowerInvoke.cpp
+24-112 files

LLVM/project 56a9bballvm/include/llvm/IR Value.h FMF.h, llvm/lib/Transforms/InstCombine InstructionCombining.cpp

[IR] SubclassOptionalData is only optional for Instruction (#200419)

BasicBlock currently uses this for HasAddressTaken. ConstantExpr uses
this for flags and it should not be possible to modify constant
expressions after they have been created.

Therefore, update the documentation accordingly and remove the unsafe
clearSubclassOptionalData.

Remove hasSameSubclassOptionalData, as it is unused.
DeltaFile
+14-25llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+4-14llvm/include/llvm/IR/Value.h
+1-4llvm/include/llvm/IR/FMF.h
+1-3llvm/lib/Transforms/Scalar/Reassociate.cpp
+2-0llvm/include/llvm/IR/Operator.h
+1-1llvm/lib/Transforms/Utils/Local.cpp
+23-476 files

LLVM/project 61e66a3llvm/include/llvm/IR IRBuilder.h, llvm/lib/Transforms/InstCombine InstructionCombining.cpp

[spr] initial version

Created using spr 1.3.8-wip
DeltaFile
+34-33llvm/include/llvm/IR/IRBuilder.h
+1-2llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+35-352 files

LLVM/project 013ee58llvm/lib/DebugInfo/PDB/Native PDBFileBuilder.cpp PDBFile.cpp, llvm/test/tools/llvm-pdbutil dxcontainer.test

Revert "Reapply "[PDB][llvm-pdbutil] Add DXContainer support for `pdb2yaml` and `yaml2pdb`"" (#200588)

Reverts llvm/llvm-project#200413

Breaks build bots:

https://lab.llvm.org/buildbot/#/builders/169/builds/23142
https://lab.llvm.org/buildbot/#/builders/25/builds/18082
DeltaFile
+0-143llvm/test/tools/llvm-pdbutil/dxcontainer.test
+22-49llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+10-40llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
+0-31llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp
+1-25llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
+0-7llvm/tools/llvm-pdbutil/PdbYaml.h
+33-2957 files not shown
+35-31413 files

LLVM/project b771021.github/workflows libc-fullbuild-tests.yml

[libc][ci] Clean up libc-fullbuild-tests precommit CI. (#200520)

- Pin containers.
- Cleaner names for different targets and options.
- Add Build Test step.
- Skip shared tests and death tests.
DeltaFile
+56-51.github/workflows/libc-fullbuild-tests.yml
+56-511 files

LLVM/project aa1cf32llvm/include/llvm/IR ValueHandle.h, llvm/unittests/IR ValueHandleTest.cpp

[IR] Fix PoisoningVH relocation of a poisoned handle (#200540)

In LLVM_ENABLE_ABI_BREAKING_CHECKS builds, when poisoned (`deleted()` or
`allUsesReplacedWith()`), a PoisoningVH is removed from its use list but
keeps its raw value pointer for identity, so its PrevPtr/Next are left
stale.

PoisoningVH has no move constructor, so relocating a value that embeds
one
falls back to the copy constructor, where `setRawValPtr` relinks with
the stale pointers and corrupts the use list.

This is a latent bug for any relocation of a PoisoningVH handle
but becomes load-bearing for #199615 , which relocating erase exercises
it via ScalarEvolution's BackedgeTakenInfo (its ExitNotTakenInfo holds a
PoisoningVH<BasicBlock>).

Fix by special casing the `Poisoned` case.
Aided By Claude Opus 4.8
DeltaFile
+34-0llvm/unittests/IR/ValueHandleTest.cpp
+18-3llvm/include/llvm/IR/ValueHandle.h
+52-32 files

LLVM/project 51256edllvm/include/llvm/IR DerivedTypes.h Type.h, llvm/lib/IR Type.cpp Use.cpp

[IR][NFC] Inline Type::isIntegerTy(n) (#200471)

Although this gets inlined in LTO builds, non-LTO builds benefit from
having isIntegerTy(n) defined in a header.

Co-authored-by: Nikita Popov <npopov at redhat.com>
DeltaFile
+8-0llvm/include/llvm/IR/DerivedTypes.h
+2-4llvm/include/llvm/IR/Type.h
+0-4llvm/lib/IR/Type.cpp
+1-0llvm/lib/IR/Use.cpp
+11-84 files

LLVM/project 92c7491llvm/lib/DebugInfo/PDB/Native PDBFileBuilder.cpp PDBFile.cpp, llvm/test/tools/llvm-pdbutil dxcontainer.test

Revert "Reapply "[PDB][llvm-pdbutil] Add DXContainer support for `pdb2yaml` a…"

This reverts commit 77800224eba1bd273c50fb1153945c38da507a52.
DeltaFile
+0-143llvm/test/tools/llvm-pdbutil/dxcontainer.test
+22-49llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+10-40llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
+0-31llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp
+1-25llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
+0-7llvm/tools/llvm-pdbutil/PdbYaml.h
+33-2957 files not shown
+35-31413 files

LLVM/project 2396aa8clang/lib/CIR/CodeGen CIRGenExprComplex.cpp

[CIR][NFC] Mark Complex visitExpr as unsupported (#197782)

Mark Complex visitExpr as unsupported, similar to Clang ORCG, not as NYI
DeltaFile
+4-2clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
+4-21 files

LLVM/project 0d1ed93libc/src/__support/CPP cstddef.h, libc/src/stdlib qsort_data.h

[libc] Tag cpp::byte with gnu::may_alias (#200462)

Clang's TBAA grants the [basic.lval]/11.3 char-aliasing privilege only
to the named ::std::byte type (Type::isStdByteType() requires the enum
to be declared in the std namespace). LIBC_NAMESPACE::cpp::byte lives in
libc's cpp namespace, so it gets its own TBAA node disjoint from char
even though it has the same shape as std::byte.

That mismatch lets the optimizer reorder typed loads past raw-byte
writes through cpp::byte *, miscompiling HeapSort on rv64/Release
(UnsortedThreeElementArray{1,2,3}, UnsortedTwoElementArray1 in
SortingTest.h). The same hazard is latent in every cpp::byte *-based
raw-aliasing site: memory_utils Ptr/CPtr, lsearch/lfind, block.h and
freelist_heap.h allocator metadata.

Tag the type with gnu::may_alias so accesses through cpp::byte * share
the universal char-aliasing TBAA node, fixing all of the above in one
place. This patch also reverts PR #194171, as the may_alias attribute
fixes it too.
DeltaFile
+14-15libc/src/stdlib/qsort_data.h
+5-1libc/src/__support/CPP/cstddef.h
+19-162 files

LLVM/project 470411cclang/lib/AST/ByteCode Compiler.cpp, clang/test/AST/ByteCode new-delete.cpp

[clang][bytecode] Loosen an assertion about operator delete (#200575)

We may also see OO_Array_Delete here.
DeltaFile
+15-0clang/test/AST/ByteCode/new-delete.cpp
+3-1clang/lib/AST/ByteCode/Compiler.cpp
+18-12 files

LLVM/project f7d5760mlir/include/mlir/Dialect/Utils IndexingUtils.h, mlir/lib/Dialect/Utils IndexingUtils.cpp

[mlir][nfc] Fix assertion text in IndexingUtils (#181826)

Update the assertion text to match the actual code behavior.
Some functions enforce strictly positive values, whereas the error
message incorrectly mentioned "nonnegative".
DeltaFile
+5-5mlir/lib/Dialect/Utils/IndexingUtils.cpp
+4-4mlir/include/mlir/Dialect/Utils/IndexingUtils.h
+9-92 files

LLVM/project ef6a217clang/lib/AST/ByteCode Compiler.cpp, clang/test/AST/ByteCode new-delete.cpp

[clang][bytecode] Fix a crash with an empty InitListExpr (#200366)

Fixes https://github.com/llvm/llvm-project/issues/200295
DeltaFile
+3-0clang/test/AST/ByteCode/new-delete.cpp
+1-1clang/lib/AST/ByteCode/Compiler.cpp
+4-12 files

LLVM/project b093c48llvm/include/llvm/IR Instruction.h, llvm/lib/Transforms/InstCombine InstructionCombining.cpp

Remove clearSubclassOptionalData

Created using spr 1.3.8-wip
DeltaFile
+14-25llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+1-3llvm/lib/Transforms/Scalar/Reassociate.cpp
+0-3llvm/include/llvm/IR/Instruction.h
+1-1llvm/lib/Transforms/Utils/Local.cpp
+16-324 files

LLVM/project c7cd58aclang/lib/CIR/Lowering/DirectToLLVM LowerToLLVMIR.cpp, clang/test/CIR/CodeGenOpenCL kernel-arg-info.cl kernel-arg-metadata.cl

[CIR][OpenCL] Lower kernel argument metadata to LLVM IR

Translate CIR OpenCL kernel argument metadata into the LLVM IR kernel_arg_* metadata attached to kernel functions. Preserve optional argument names so -cl-kernel-arg-info controls the LLVM metadata surface through the CIR attribute.
DeltaFile
+74-1clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVMIR.cpp
+60-0clang/test/CIR/CodeGenOpenCL/kernel-arg-info.cl
+12-0clang/test/CIR/CodeGenOpenCL/kernel-arg-metadata.cl
+12-0clang/test/CIR/CodeGenOpenCL/kernel-arg-info-single-as.cl
+158-14 files

LLVM/project ef04777clang/lib/CIR/CodeGen CIRGenModule.cpp CIRGenModule.h, clang/test/CIR/CodeGenOpenCL kernel-arg-info.cl kernel-arg-info-single-as.cl

[CIR][OpenCL] Attach kernel argument metadata to CIR functions

Emit the CIR OpenCL kernel argument metadata attribute for kernel functions. Preserve CIR language address-space kinds until lowering and include argument names only when `-cl-kernel-arg-info` is enabled.

Depends on #199530.
DeltaFile
+152-0clang/test/CIR/CodeGenOpenCL/kernel-arg-info.cl
+83-0clang/lib/CIR/CodeGen/CIRGenModule.cpp
+19-0clang/test/CIR/CodeGenOpenCL/kernel-arg-info-single-as.cl
+7-0clang/test/CIR/CodeGenOpenCL/kernel-arg-metadata.cl
+4-0clang/lib/CIR/CodeGen/CIRGenModule.h
+3-0clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+268-06 files

LLVM/project 30ec1faclang/lib/AST/ByteCode Compiler.cpp, clang/test/AST/ByteCode invalid.cpp

[clang][bytecode] Reject invalid UnaryOperators (#200394)
DeltaFile
+10-0clang/test/AST/ByteCode/invalid.cpp
+3-0clang/lib/AST/ByteCode/Compiler.cpp
+13-02 files

LLVM/project 3c95dd2llvm/lib/Transforms/Vectorize VPlanAnalysis.cpp VPlan.h

[VPlan] Thread scalar type through VPBlend, VPExpression recipes. (NFC) (#200255)

Set the scalar type for VPBlendRecipe and VPExpressionRecipe at
construction time, instead of inferring it on demand via VPTypeAnalysis.
With this change, all VPValues have their scalar type set at
construction, so VPTypeAnalysis::inferScalarType becomes a thin wrapper
around VPValue::getScalarType.

To be removed in a follow-up:
https://github.com/llvm/llvm-project/pull/200256.

PR: https://github.com/llvm/llvm-project/pull/200255
DeltaFile
+3-41llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+5-3llvm/lib/Transforms/Vectorize/VPlan.h
+4-1llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+4-0llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+0-3llvm/lib/Transforms/Vectorize/VPlanAnalysis.h
+16-485 files

LLVM/project e2106aellvm/include/llvm/IR DerivedTypes.h Type.h, llvm/lib/IR Use.cpp

more out of line

Created using spr 1.3.8-wip
DeltaFile
+8-0llvm/include/llvm/IR/DerivedTypes.h
+2-6llvm/include/llvm/IR/Type.h
+1-0llvm/lib/IR/Use.cpp
+11-63 files

LLVM/project 2501cddllvm/test/CodeGen/X86 vector-shuffle-combining-avx512vbmi2.ll

[X86] Add VBMI2 shuffle test to track miscompile reported in #200136 (#200569)
DeltaFile
+16-0llvm/test/CodeGen/X86/vector-shuffle-combining-avx512vbmi2.ll
+16-01 files

LLVM/project d46e7dcclang/lib/AST/ByteCode Interp.h, clang/test/AST/ByteCode c.c

[clang][bytecode] Fix an assertion failure in AddSubNonNumber (#200393)

Calling Integral::getPtr() shouldn't happen for AddrLabelDiff integrals.
DeltaFile
+8-0clang/test/AST/ByteCode/c.c
+6-0clang/lib/AST/ByteCode/Interp.h
+14-02 files