LLVM/project cfb9a0bclang/lib/CodeGen/TargetBuiltins ARM.cpp, clang/test/CodeGen/AArch64/sve2p1-intrinsics acle_sve2p1_psel.c acle_sve2p1_psel_svcount.c

[SVE ACLE] Add svcount support to llvm.aarch64.sve.psel intrinsic. (#217360)

PSEL has genuine support for predicate-as-counter, so it seems fair for
its equivalent intrinsic to have matching support rather than indirect
support using the svbool variant.
DeltaFile
+91-12llvm/test/CodeGen/AArch64/sve2-intrinsics-psel.ll
+22-38clang/test/CodeGen/AArch64/sve2p1-intrinsics/acle_sve2p1_psel_svcount.c
+3-16clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+8-8clang/test/CodeGen/AArch64/sve2p1-intrinsics/acle_sve2p1_psel.c
+9-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+4-4mlir/test/Target/LLVMIR/arm-sve.mlir
+137-782 files not shown
+140-818 files

LLVM/project 8e65884llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination induction-condition-in-loop-exit-postinc.ll

[ConstraintElim] Derive facts for negative-step post-decrement cmps. (#218437)

Update addInfoForInductions to also add facts for negative step
inductions when comparing a post-inc induction.

The negative step support currently requires a step of -1, so the only
difference is the predicate of the precondition: for post-inc compares,
we exit at PN == B + 1, so strict predicates (B < StartValue) is used.

Helps to simplify a number of branches end-to-end in real world
workloads:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1025.

Note that there is one case where we now fail to runtime-unroll, as the
removed branch pessimizes SCEV, but I think this is a pre-existing
issue, and the vast majority of changes are improvements.

Alive2 Proofs: https://alive2.llvm.org/ce/z/LbJYNA

PR: https://github.com/llvm/llvm-project/pull/218437
DeltaFile
+58-24llvm/test/Transforms/ConstraintElimination/induction-condition-in-loop-exit-postinc.ll
+21-16llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+79-402 files

LLVM/project f0c38adclang/lib/CodeGen/TargetBuiltins ARM.cpp, clang/test/CodeGen/AArch64/sve2p1-intrinsics acle_sve2p1_pfalse.c

[Clang][SVE] Zero svcount_t directly rather than casting a svbool_t zero. (#217256)
DeltaFile
+2-6clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+2-4clang/test/CodeGen/AArch64/sve2p1-intrinsics/acle_sve2p1_pfalse.c
+4-102 files

LLVM/project 02555b7clang/include/clang/Analysis AnyCall.h, clang/include/clang/Analysis/Analyses/LifetimeSafety FactsGenerator.h LifetimeAnnotations.h

[Lifetime Safety] Normalize call arguments in AnyCall (#217838)

`AnyCall::arguments()` now returns a normalized argument list.

For instance member calls, the implicit object argument is included as
argument 0. For static `operator()` calls, the syntactic object operand
is excluded so the result matches the actual callable parameters.

LifetimeSafety now uses this normalized `AnyCall` argument list through
a small `FunctionCallInfo` helper, avoiding duplicated call argument
setup while keeping argument normalization in `AnyCall`.

Tests were added for:

- ordinary member calls with implicit object arguments
- non-static `operator()` calls where the object is already present
- static `operator()` calls where the object operand should be excluded

Follow-up to PR #206337

    [3 lines not shown]
DeltaFile
+86-5clang/unittests/Analysis/AnyCallTest.cpp
+13-27clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+26-10clang/include/clang/Analysis/AnyCall.h
+11-17clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+3-4clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
+1-3clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
+140-666 files

LLVM/project a4f4a06llvm/test/Transforms/VectorCombine/X86 load.ll load-inseltpoison.ll

[VectorCombine] Drop nofree nosync from tests (NFC) (#218656)

These are not actually needed, and we'd want to know if they
became necessary.
DeltaFile
+30-30llvm/test/Transforms/VectorCombine/X86/load-inseltpoison.ll
+28-28llvm/test/Transforms/VectorCombine/X86/load.ll
+58-582 files

LLVM/project 4c7637cclang/test/Analysis/Scalable/source-edit-generation write-failure.cpp happy-path.cpp

Fix up UNSUPPORTED line in test originally set in #218572 and #218617 for rdar://185749574. (#218651)
DeltaFile
+1-1clang/test/Analysis/Scalable/source-edit-generation/write-failure.cpp
+1-1clang/test/Analysis/Scalable/source-edit-generation/happy-path.cpp
+1-1clang/test/Analysis/Scalable/source-edit-generation/coexistence.cpp
+3-33 files

LLVM/project eb561aellvm/lib/IR Verifier.cpp, llvm/lib/Target/RISCV RISCVTargetTransformInfo.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.6-beta.1
DeltaFile
+128-0llvm/test/Transforms/InstCombine/RISCV/riscv-vsetvli-range.ll
+107-0llvm/test/Transforms/InstCombine/RISCV/riscv-vsetvlimax-range.ll
+52-0llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+29-0llvm/test/Verifier/RISCV/vsetvli.ll
+23-0llvm/lib/IR/Verifier.cpp
+339-05 files

LLVM/project 4e26b34llvm/lib/IR Verifier.cpp, llvm/test/Verifier/RISCV vsetvli.ll

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.6-beta.1

[skip ci]
DeltaFile
+29-0llvm/test/Verifier/RISCV/vsetvli.ll
+23-0llvm/lib/IR/Verifier.cpp
+52-02 files

LLVM/project 013ab33llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 combine-adc.ll

[X86] Allow disjoint ors in combineAddOrSubToADCOrSBB (#218410)

This allows folding ORs to ADC.
DeltaFile
+45-0llvm/test/CodeGen/X86/combine-adc.ll
+6-0llvm/lib/Target/X86/X86ISelLowering.cpp
+51-02 files

LLVM/project 3ee4577clang-tools-extra/clang-include-fixer/find-all-symbols/tool run-find-all-symbols.py, clang-tools-extra/clangd/test/remote-index pipeline_helper.py

[clang-tools-extra] Unify python shebangs (#187287)

As per PEP-0394[1], there is no real concensus over what binary names
Python has, specifically 'python' could be Python 3, Python 2, or not
exist.

However, everyone has a python3 interpreter and the scripts are all
written for Python 3. Unify the shebangs so that the ~50% of shebangs
that use python now use python3.

[1] https://peps.python.org/pep-0394/
DeltaFile
+1-1clang-tools-extra/clangd/test/remote-index/pipeline_helper.py
+1-1clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+2-22 files

LLVM/project 26b9a17mlir/docs Canonicalization.md DialectConversion.md

[mlir:doc] Clarify requirements on `RewritePatterns`. (#218351)

This PR clarifies and extends the documentation of what
`RewritePattern`s and folders are allowed to do. The most noteworthy
addition is the requirement that they must produce verifiable IR. While
this is enforced by `MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS`, it has
not been mentioned in the markdown docs yet. The other changes are
clarifications on edge cases that I have seen people misunderstand or
overlook. The change also adds a note to the build flag that enables the
API checks.

---------

Signed-off-by: Ingo Müller <ingomueller at google.com>
DeltaFile
+17-1mlir/docs/PatternRewriter.md
+4-2mlir/docs/DialectConversion.md
+3-1mlir/docs/Canonicalization.md
+24-43 files

LLVM/project a657718clang/lib/StaticAnalyzer/Checkers ArrayBoundChecker.cpp, clang/test/Analysis/ArrayBound verbose-tests.c

[analyzer] Implement potential underflow warnings (#216077)

The `security.ArrayBound` checker is able to report potential
out-of-bounds access when it detects that the accessed offset is tainted
(potentially attacker-controlled).

However, until now this only reported cases where _overflow_ was
possible with the tainted offset. (This is probably an accidental
oversight -- in the old implementation it was easy to forget adding a
second check that would report the "potential underflow with tainted
offset" case.)

This commit corrects this oversight and ensures that potential underflow
with a tainted offset is also correctly reported.

Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
DeltaFile
+56-0clang/test/Analysis/ArrayBound/verbose-tests.c
+14-12clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+70-122 files

LLVM/project b15a185mlir/lib/Dialect/Vector/Transforms VectorTransforms.cpp

[NFC] minor formatting change (#218647)

Required in https://github.com/llvm/llvm-project/pull/212180
DeltaFile
+1-1mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
+1-11 files

LLVM/project 30ad5ccllvm/lib/ExecutionEngine/Orc COFFPlatform.cpp

[ORC] Use a weak recordAddr in runSymbolIfExists (#218591)

COFFPlatform::runSymbolIfExists resolved the symbol as required, then
swallowed the resulting SymbolsNotFound error. Use a weakly-referenced
recordAddr and test the address instead. This was the last non-test
caller of lookupAndRecordAddrs.
DeltaFile
+15-19llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
+15-191 files

LLVM/project b184375libcxx/include __config print, libcxx/include/__cxx03 __config

[libc++] Remove _LIBCPP_SHORT_WCHAR (#207562)

We can just check for `sizeof(wchar_t)` in most places instead. The only
place that seems problematic is `test_macros.h`, where we can use
`__SIZEOF_WCHAR_T__` instead.
DeltaFile
+96-151libcxx/src/locale.cpp
+6-13libcxx/include/print
+0-6libcxx/include/__cxx03/__config
+0-6libcxx/include/__config
+1-1libcxx/test/support/test_macros.h
+103-1775 files

LLVM/project d4205a3libcxx/include/__memory uninitialized_algorithms.h, libcxx/include/__vector vector.h

[libc++] Optimize vector::erase (#213916)

This optimization is for trivially relocatable types. Instead of move
assigning the tail and then destroying the last N elements, we now
destroy the elements that are erased and then relocate the tail forward.
DeltaFile
+33-24libcxx/include/__vector/vector.h
+34-0libcxx/include/__memory/uninitialized_algorithms.h
+67-242 files

LLVM/project 1b695ceclang/include/clang/StaticAnalyzer/Core/PathSensitive CoreEngine.h ExprEngine.h, clang/lib/StaticAnalyzer/Core ExprEngineCallAndReturn.cpp ExprEngine.cpp

[NFC][analyzer] Remove class 'NodeBuilderContext' (#218442)

The class `NodeBuilderContext` was heavily distorted during the ad hoc
development of the analyzer: it was not actually that useful for
building nodes (it could have been replaced by a single pointer to the
`CoreEngine`), but it gained a second unrelated role that it was
involved in the only way to query the current `CFGBlock`. This class had
no actual advantage, but until the start of this year it was widely used
in low quality parts of the engine code.

After dozens of cleanup commits I was finally able to remove
`NodeBuilder` in 3a8697fab84c8d61e7fc4370c19bdd5023391716, so now I can
remove `NodeBuilderContext` in this commit.
DeltaFile
+12-49clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
+0-32clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
+4-4clang/test/Analysis/stack-frame-context-revision.cpp
+2-2clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+1-1clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+1-1clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+20-891 files not shown
+20-907 files

LLVM/project f34b49elldb/source/Expression DWARFExpression.cpp, lldb/unittests/Expression DWARFExpressionTest.cpp

[lldb] Evaluate DW_OP_mod with unsigned arithmetic (#218383)

LLDB currently passes the signed `Scalar` values produced by
`DW_OP_consts`
directly to `Scalar::operator%`. As a result, the issue expression
evaluates
`-1 % 2` as signed remainder `-1` instead of interpreting the all-one
address-sized value modulo 2 as `1`.

Make local copies of the `DW_OP_mod` dividend and divisor unsigned
before
applying the existing modulo operator. The change is contained entirely
in
the opcode evaluator and does not alter the global `Scalar`
implementation.

Update the `DW_OP_mod` unit test with the issue reproducer.

Tests:

    [8 lines not shown]
DeltaFile
+12-3lldb/unittests/Expression/DWARFExpressionTest.cpp
+6-0lldb/source/Expression/DWARFExpression.cpp
+18-32 files

LLVM/project 6e72de8clang/test/CodeGen/AArch64 abi-classify-arg-types.c abi-classify-arg-types.cpp

[Clang] Update new tests for nofreeobj (#218643)

Account for the change from #218404.
DeltaFile
+3-3clang/test/CodeGen/AArch64/abi-classify-arg-types.cpp
+1-1clang/test/CodeGen/AArch64/abi-classify-arg-types.c
+4-42 files

LLVM/project a142691flang/lib/Optimizer/CodeGen CodeGen.cpp, flang/test/Fir global-initialization.fir

fix folding interaction
DeltaFile
+12-7flang/lib/Optimizer/CodeGen/CodeGen.cpp
+15-0flang/test/Fir/global-initialization.fir
+27-72 files

LLVM/project ee82d66clang/www cxx_status.html

[Clang][docs] Tweaks entries for recent DRs (#189187)

1. According to WG21 N5031, P3868R1 is also a DR.
2. Consistently add one space between the link and `(`.
3. Show the "Yes" status in a green cell (`class="full"`).
DeltaFile
+8-8clang/www/cxx_status.html
+8-81 files

LLVM/project 1a54cfbllvm/include/llvm/Transforms/Utils LoopUtils.h, llvm/lib/Transforms/Utils LoopUtils.cpp

[LoopUtils] Return 0 for estimated zero trip count loops. (#217330)

getLoopEstimatedTripCount previously returned std::nullopt for loops
with estimated tip counts of zero. This was historically due to some
callers expecting trip counts > 0.

After auditing all callers, it looks like only one call in LoopVectorize
cannot handle zero trip counts (would lead to divide by 0). Updating the
code there to explicitly check for 0 allows us to update
getEstimatedTripCount to return 0 instead of std::nullopt.

This allows us to properly preserve branch weights in the remainder
loops when vectorizing the loop, for cases where the remainder does not
execute per the estimate via updateLoopMetadataAndProfileInfo.

This fixes ~120 prof-check failures in the LoopVectorizer tests.

PR: https://github.com/llvm/llvm-project/pull/217330
DeltaFile
+208-0llvm/test/Transforms/LoopUnroll/estimated-trip-count.ll
+38-38llvm/test/Transforms/LoopVectorize/AArch64/check-prof-info.ll
+15-18llvm/test/Transforms/LoopVectorize/branch-weights.ll
+7-7llvm/unittests/Transforms/Utils/LoopUtilsTest.cpp
+8-6llvm/include/llvm/Transforms/Utils/LoopUtils.h
+2-10llvm/lib/Transforms/Utils/LoopUtils.cpp
+278-793 files not shown
+299-859 files

LLVM/project 74f4eb5llvm/lib/Target/AMDGPU GCNProcessors.td AMDGPU.td, llvm/test/Object/AMDGPU elf-header-flags-mach.yaml

[AMDGPU] Define gfx1250-strict target
DeltaFile
+30-0llvm/lib/Target/AMDGPU/AMDGPU.td
+9-0llvm/test/tools/llvm-readobj/ELF/AMDGPU/elf-headers.test
+7-0llvm/test/Object/AMDGPU/elf-header-flags-mach.yaml
+6-0llvm/lib/Target/AMDGPU/GCNProcessors.td
+5-0llvm/unittests/TargetParser/TargetParserTest.cpp
+5-0llvm/test/tools/llvm-objdump/ELF/AMDGPU/subtarget.ll
+62-015 files not shown
+91-221 files

LLVM/project 542e06bclang/lib/Sema TreeTransform.h SemaConcept.cpp, clang/test/SemaCXX cxx2c-fold-exprs.cpp

[Clang] Fix C++26 fold expression normalization of PackIndexingExpr (#218577)

It turns out that PackIndexingExpr doesn't create any PackExpansionTypes
for unexpanded packs and thus we don't have to remove the packs during
the normalization.

This also reverts the previous attempt f3fd5b2dd9 that doesn't
completely solve the problem.

Fixes #218548
DeltaFile
+18-0clang/test/SemaCXX/cxx2c-fold-exprs.cpp
+6-0clang/lib/Sema/SemaConcept.cpp
+0-4clang/lib/Sema/TreeTransform.h
+24-43 files

LLVM/project a9a1e7cllvm/test/CodeGen/AMDGPU addrspacecast-barrier.ll

rebase
DeltaFile
+3-0llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+3-01 files

LLVM/project 1428135clang/lib/Driver/ToolChains Flang.cpp, flang/test/Driver flang-dwarf-version.f90

[flang][driver] Honour the toolchain default DWARF version (#217610)

The driver only rendered -dwarf-version= when the user named a version
explicitly with -gdwarf-N. With plain -g the option was omitted, and the
backend fell back to dwarf::DWARF_VERSION. As a result `flang -g` always
produced DWARF 4 while `clang -g` produced the toolchain default for the
same target..

The fix is to generate the "-dwarf-version" flag when either the debug
information is enabled or an explicit -gdwarf-N is given.

---------

Co-authored-by: Cursor <cursoragent at cursor.com>
Co-authored-by: Tarun Prabhu <tarunprabhu at gmail.com>
DeltaFile
+47-6flang/test/Driver/flang-dwarf-version.f90
+8-1clang/lib/Driver/ToolChains/Flang.cpp
+55-72 files

LLVM/project 906838dllvm/lib/Target/AMDGPU SIISelLowering.cpp AMDGPUMemoryUtils.h, llvm/test/CodeGen/AMDGPU addrspacecast-barrier.ll

Comments
DeltaFile
+4-3llvm/lib/Target/AMDGPU/SIDefines.h
+1-3llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+1-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+1-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+9-106 files

LLVM/project f7aa0dfllvm/docs AMDGPUUsage.rst

Update docs
DeltaFile
+20-13llvm/docs/AMDGPUUsage.rst
+20-131 files

LLVM/project f818ae7llvm/docs AMDGPUUsage.rst

Comments
DeltaFile
+1-1llvm/docs/AMDGPUUsage.rst
+1-11 files

LLVM/project e1c33b4llvm/docs AMDGPUUsage.rst, llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.cpp SIDefines.h

[AMDGPU] Add synthetic apertures and use them for barriers

Define what a synthetic aperture is, and adjust the barrier AS
to use this new system. This makes the barrier AS even safer to
use as now we can use all 32 bits of it without ever risking
hitting a valid address of any kind (LDS or outside LDS).
DeltaFile
+72-90llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+44-5llvm/docs/AMDGPUUsage.rst
+21-23llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+18-17llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+12-0llvm/lib/Target/AMDGPU/SIDefines.h
+9-0llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+176-1354 files not shown
+186-14010 files