LLVM/project 8811c2bllvm/lib/Transforms/Scalar ConstantHoisting.cpp

[ConstantHoisting] Avoid DenseMap reference invalidated by insertion (#199468)

Fix https://reviews.llvm.org/D28962 : DenseMap does not promise to keep
references stable across insertion. This happens to work today because
we don't do bucket eviction.

Pre-populate every node up front.
DeltaFile
+6-4llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
+6-41 files

LLVM/project a49c16aclang/include/clang/Serialization ASTRecordReader.h, clang/lib/AST ASTContext.cpp Type.cpp

trivial changes
DeltaFile
+20-14clang/lib/Sema/SemaOpenMP.cpp
+18-14clang/lib/AST/ASTContext.cpp
+16-15clang/lib/Sema/SemaTemplate.cpp
+14-11clang/lib/AST/Type.cpp
+14-8clang/lib/AST/ASTDiagnostic.cpp
+11-6clang/include/clang/Serialization/ASTRecordReader.h
+93-6833 files not shown
+202-15239 files

LLVM/project 7f629daclang/include/clang/AST ASTContext.h, clang/lib/AST ASTContext.cpp ItaniumMangle.cpp

[clang] implement CWG2064: ignore value dependence for decltype

The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.

This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.

This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.

Fixes #8740
Fixes #61818
Fixes #190388
DeltaFile
+888-161clang/lib/AST/ASTContext.cpp
+328-12clang/test/SemaTemplate/instantiation-dependence.cpp
+176-96clang/lib/AST/ItaniumMangle.cpp
+100-98clang/lib/Sema/SemaCXXScopeSpec.cpp
+62-57clang/lib/AST/Type.cpp
+88-11clang/include/clang/AST/ASTContext.h
+1,642-43569 files not shown
+2,385-79675 files

LLVM/project a029fb9clang/test/CodeGenCXX visibility.cpp, clang/test/Modules template-default-args-3.cpp template-default-args-2.cpp

[clang] NFC: add some new test cases (#199467)

These are extracted from my current and future PRs.

They don't have much to do with the PRs themselves except that they were
regressions our test suite missed catching.
DeltaFile
+36-0clang/test/Modules/template-default-args-3.cpp
+30-0clang/test/Modules/template-default-args-2.cpp
+22-0clang/test/CodeGenCXX/visibility.cpp
+7-0clang/test/SemaTemplate/partial-spec-instantiate.cpp
+7-0clang/test/SemaTemplate/generic-lambda.cpp
+102-05 files

LLVM/project 11f0e77llvm/lib/CodeGen GCRootLowering.cpp, llvm/test/CodeGen/Generic gc-lowering.ll

[CodeGen][GC] Initialize roots with `Constant::getNullValue()` instead of `ConstantPointerNull::get()` (#199367)

Fixes #199219
DeltaFile
+26-0llvm/test/CodeGen/Generic/gc-lowering.ll
+2-3llvm/lib/CodeGen/GCRootLowering.cpp
+28-32 files

LLVM/project ab17454llvm/lib/Transforms/Vectorize LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize select-cmp-blend-chain.ll

Revert "[LV] Handle chained selects/blends when creating new rdx chain. (#199443)" (#199461)

This reverts commit 3f561eab147abf17c1838b4e3dc19837837a9740 due to
buildbot breakage
((https://lab.llvm.org/staging/#/builders/7/builds/1736/steps/9/logs/stdio).
DeltaFile
+0-284llvm/test/Transforms/LoopVectorize/select-cmp-blend-chain.ll
+24-25llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+24-3092 files

LLVM/project 248d1e8clang/test/CodeGenCXX visibility.cpp, clang/test/Modules template-default-args-3.cpp template-default-args-2.cpp

[clang] NFC: add some new test cases

These are extracted from my current and future PRs.

They don't have much to do with the PRs themselves except that
they were regressions our test suite missed catching.
DeltaFile
+36-0clang/test/Modules/template-default-args-3.cpp
+30-0clang/test/Modules/template-default-args-2.cpp
+22-0clang/test/CodeGenCXX/visibility.cpp
+7-0clang/test/SemaTemplate/generic-lambda.cpp
+7-0clang/test/SemaTemplate/partial-spec-instantiate.cpp
+102-05 files

LLVM/project 53afbc8bolt/include/bolt/Profile DataAggregator.h, bolt/lib/Profile DataAggregator.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.4
DeltaFile
+150-49bolt/lib/Profile/DataAggregator.cpp
+24-6bolt/include/bolt/Profile/DataAggregator.h
+6-24bolt/tools/driver/llvm-bolt.cpp
+21-2bolt/tools/merge-fdata/merge-fdata.cpp
+22-0bolt/test/merge-fdata-no-lbr-event-multi.test
+10-9bolt/lib/Utils/CommandLineOpts.cpp
+233-909 files not shown
+310-9515 files

LLVM/project 925a1e7bolt/include/bolt/Profile DataAggregator.h, bolt/lib/Profile DataAggregator.cpp

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

Created using spr 1.3.4

[skip ci]
DeltaFile
+120-47bolt/lib/Profile/DataAggregator.cpp
+6-24bolt/tools/driver/llvm-bolt.cpp
+19-4bolt/include/bolt/Profile/DataAggregator.h
+21-2bolt/tools/merge-fdata/merge-fdata.cpp
+22-0bolt/test/merge-fdata-no-lbr-event-multi.test
+18-0bolt/test/merge-fdata-no-lbr-event.test
+206-776 files not shown
+240-8812 files

LLVM/project e8bd5dcllvm/utils/gn/secondary/clang/tools/clang-sycl-linker BUILD.gn

[gn build] Add missing clang-sycl-linker dependency (#199464)
DeltaFile
+1-0llvm/utils/gn/secondary/clang/tools/clang-sycl-linker/BUILD.gn
+1-01 files

LLVM/project 25294a2.github/workflows release-binaries.yml

workflows/release-binaries: Validate input and remove template expansion (#199434)

https://github.com/llvm/llvm-project/security/code-scanning/1699
https://github.com/llvm/llvm-project/security/code-scanning/1700
https://github.com/llvm/llvm-project/security/code-scanning/1701
https://github.com/llvm/llvm-project/security/code-scanning/1702
https://github.com/llvm/llvm-project/security/code-scanning/1703
https://github.com/llvm/llvm-project/security/code-scanning/1704
https://github.com/llvm/llvm-project/security/code-scanning/1705
https://github.com/llvm/llvm-project/security/code-scanning/1706
https://github.com/llvm/llvm-project/security/code-scanning/1707
https://github.com/llvm/llvm-project/security/code-scanning/1708
https://github.com/llvm/llvm-project/security/code-scanning/1709
https://github.com/llvm/llvm-project/security/code-scanning/1710
https://github.com/llvm/llvm-project/security/code-scanning/1711
DeltaFile
+27-12.github/workflows/release-binaries.yml
+27-121 files

LLVM/project 643f8c2llvm/lib/Transforms/Vectorize LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize select-cmp-blend-chain.ll

Revert "[LV] Handle chained selects/blends when creating new rdx chain. (#199…"

This reverts commit 3f561eab147abf17c1838b4e3dc19837837a9740.
DeltaFile
+0-284llvm/test/Transforms/LoopVectorize/select-cmp-blend-chain.ll
+24-25llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+24-3092 files

LLVM/project 72d747dlibcxx/test/std/utilities/memory/specialized.algorithms destroy.h, libcxx/test/support algorithms.h

[libc++][test] Move backported algorithms to `libcxx/test/support` (#199431)

And namespace `util`. This will make helpers provided more consistently,
and potentially allow us to unify test helper namespaces in the future.
DeltaFile
+49-0libcxx/test/support/algorithms.h
+0-47libcxx/test/std/utilities/memory/specialized.algorithms/destroy.h
+49-472 files

LLVM/project 38a8cd7clang/lib/Analysis/LifetimeSafety Checker.cpp

[LifetimeSafety] Fix use-after-scope from #198784 (#199455)

This fixes a use-after-scope introduced by #198784 (reported in
https://github.com/llvm/llvm-project/pull/198784#issuecomment-4530043621),
by manually extending the lifetime.

AFAIK clang is built using C++17 [*], hence C++23 P2718R0's lifetime
extension in range-based for loops does not apply.

[*] "Unless otherwise documented, LLVM subprojects are written using
standard C++17 code"
(https://llvm.org/docs/CodingStandards.html#c-standard-versions)
DeltaFile
+5-2clang/lib/Analysis/LifetimeSafety/Checker.cpp
+5-21 files

LLVM/project 3ad076e.github/workflows release-sources.yml

workflows/release-sources: Validate input and remove template expansion (#199426)

https://github.com/llvm/llvm-project/security/code-scanning/1730
https://github.com/llvm/llvm-project/security/code-scanning/1731
https://github.com/llvm/llvm-project/security/code-scanning/1732
https://github.com/llvm/llvm-project/security/code-scanning/1733
DeltaFile
+14-5.github/workflows/release-sources.yml
+14-51 files

LLVM/project 3cfce5fllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/PhaseOrdering/AArch64 reduce_submuladd.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+219-41llvm/test/Transforms/SLPVectorizer/insert-element-build-vector.ll
+219-41llvm/test/Transforms/SLPVectorizer/insert-element-build-vector-inseltpoison.ll
+137-42llvm/test/Transforms/SLPVectorizer/X86/dot-product.ll
+138-30llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+31-98llvm/test/Transforms/PhaseOrdering/AArch64/reduce_submuladd.ll
+44-56llvm/test/Transforms/SLPVectorizer/X86/horizontal-list.ll
+788-30836 files not shown
+1,088-76342 files

LLVM/project 45fa0a1clang/test/Driver crash-ir-repro.cpp

[Clang][Driver] Reenable test on UBSan/HWAsan (#199448)

It passes locally, presumably due to
15488a7f78ce7b9ae3c06b031134e5cb339b335c fixing the behavior here.
DeltaFile
+0-5clang/test/Driver/crash-ir-repro.cpp
+0-51 files

LLVM/project 25db538.github/workflows docs.yml release-doxygen.yml, llvm/docs requirements.txt requirements-hashed.txt

workflows: Require hashed dependencies when installing docs dependencies (#197306)
DeltaFile
+371-10llvm/docs/requirements.txt
+0-371llvm/docs/requirements-hashed.txt
+10-0llvm/docs/requirements.txt.in
+2-2.github/workflows/docs.yml
+1-1.github/workflows/release-doxygen.yml
+1-1.github/workflows/release-documentation.yml
+385-3856 files

LLVM/project 3f561eallvm/lib/Transforms/Vectorize LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize select-cmp-blend-chain.ll

[LV] Handle chained selects/blends when creating new rdx chain. (#199443)

Make sure we recursively clone chains of selects/blends when re-creating
a reduction chain with new types.

Fixes https://github.com/llvm/llvm-project/issues/199406.
DeltaFile
+284-0llvm/test/Transforms/LoopVectorize/select-cmp-blend-chain.ll
+25-24llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+309-242 files

LLVM/project aa86415.github/workflows/unprivileged-download-artifact action.yml

workflows/unprivileged-download-artifact: Remove template expansion (#199107)

https://github.com/llvm/llvm-project/security/code-scanning/1749
https://github.com/llvm/llvm-project/security/code-scanning/1752
https://github.com/llvm/llvm-project/security/code-scanning/1753
https://github.com/llvm/llvm-project/security/code-scanning/1879
https://github.com/llvm/llvm-project/security/code-scanning/1880
DeltaFile
+17-9.github/workflows/unprivileged-download-artifact/action.yml
+17-91 files

LLVM/project 1503b86llvm/lib/Target/AArch64 AArch64SchedCyclone.td

[NFC][AArch64][Cyclone] Model WriteSTP with a local SchedWriteRes (#198844)

Cyclone scheduling model uses SchedAlias between 2 SchedWriteRes
definitions from AArch64Schedule.td.
This prevents other scheduling models from aliasing WriteSTP. This patch
address the issue by defining a new CyWriteSTP and using that instead.
DeltaFile
+6-1llvm/lib/Target/AArch64/AArch64SchedCyclone.td
+6-11 files

LLVM/project 0068f46llvm/lib/Transforms/Vectorize LoopVectorizationPlanner.h VPlanUtils.cpp

[VPlan] Simplify VPSCEVExpander, clarify naming/comments (NFC). (#199423)

Address post-commit comments from
https://github.com/llvm/llvm-project/pull/189455,
removing unneeded member, and clarify naming/comments to stress the
current logic tries to expand a SCEV to VPInstructions, with only a small 
sub-set of SCEV expression supported.
DeltaFile
+9-10llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+4-6llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+2-2llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+1-1llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+16-194 files

LLVM/project bb02cabllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV ordered-reduction.ll

[SLP] Ensure TreeCost is scaled for ordered fadd reductions (#199388)

Resolves #199267

Addresses an issue where `getScaleToLoopIterations()` can return 1 on
isolated SLP trees because `UserTreeIndex` is invalid. This prevents
`TreeCost` from scaling alongside `ReductionCost`, causing the cost
model to incorrectly treat an unprofitable vector reduction as
profitable.

This patch passes the reduction root instruction down into
`calculateTreeCostAndTrimNonProfitable` and the underlying scale
calculation so `getScaleToLoopIterations` can get the correct block
context.
DeltaFile
+18-10llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+7-9llvm/test/Transforms/SLPVectorizer/RISCV/ordered-reduction.ll
+25-192 files

LLVM/project 133ad80llvm/lib/CodeGen CodeGenPrepare.cpp, llvm/test/Transforms/CodeGenPrepare/X86 null-psi-no-crash.ll

[CodeGenPrepare] Report an error if ProfileSummaryAnalysis is not available (#199268)

CodeGenPreparePass can't declare ProfileSummaryAnalysis as required,
because PSA is a module-level analysis, but CFP is a function-level pass.
Therefore it accesses PSA using getCachedResult, and PSA might be null.

In practice this doesn't happen, because the CGP pass pipeline
preparation code ensures that PSA is present. But if you invoke
CGP via opt -passes=codegenprepare, then it's not
there, and we segfault.

Fix for https://github.com/llvm/llvm-project/issues/173360.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
DeltaFile
+8-0llvm/test/Transforms/CodeGenPrepare/X86/null-psi-no-crash.ll
+3-0llvm/lib/CodeGen/CodeGenPrepare.cpp
+11-02 files

LLVM/project eceae62clang/lib/CIR/CodeGen CIRGenBuiltinAArch64.cpp, clang/test/CodeGen/AArch64/neon getset.c

[clang][CIR][nfc] Remove redundant code + update run lines (#199049)

This is just a minor clean-up post #186119.
DeltaFile
+3-3clang/test/CodeGen/AArch64/neon/getset.c
+0-4clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+3-72 files

LLVM/project 6302439llvm/include/llvm/ADT DenseMap.h, llvm/lib/Analysis ScalarEvolution.cpp

[llvm,clang] Don't assume non-erased DenseMap entries remain valid after erase. NFC (#198982)

In preparation for switching DenseMap from tombstone deletion to
backward-shift deletion, update call sites that reuse an iterator or a
bucket reference after erasing another entry from the same map.

These work under tombstone deletion because unrelated buckets stay put,
but backward-shift deletion relocates entries to close the gap.

Add DenseMap::remove_if, similar to SmallPtrSet::remove_if, as
replacement for erase-while-iterating, and use it where applicable.

Aided by Claude Opus 4.7
DeltaFile
+45-0llvm/unittests/ADT/DenseMapTest.cpp
+13-27llvm/lib/IR/LegacyPassManager.cpp
+27-0llvm/include/llvm/ADT/DenseMap.h
+5-17llvm/lib/Analysis/ScalarEvolution.cpp
+8-13llvm/lib/ExecutionEngine/Orc/Core.cpp
+8-11llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+106-6818 files not shown
+212-13424 files

LLVM/project 69a5cf5clang/lib/Analysis/LifetimeSafety Checker.cpp, clang/test/Sema warn-lifetime-safety-suggestions.cpp warn-lifetime-safety-misplaced-lifetimebound-cross-tu.cpp

[LifetimeSafety] Extend suggestions for `lifetimebound` to also warn on canonical declarations  (#198784)

With this patch, we suggest adding the `clang::lifetimebound` attribute
on the canonical declaration and on the earliest redeclaration in each
other file, preserving diagnostics for declarations visible from other
translation units while avoiding duplicate suggestions within the same
file.

Fixes #198624
Fixes #198628
DeltaFile
+62-76clang/lib/Analysis/LifetimeSafety/Checker.cpp
+67-12clang/test/Sema/warn-lifetime-safety-suggestions.cpp
+14-0clang/test/Sema/warn-lifetime-safety-misplaced-lifetimebound-cross-tu.cpp
+4-5clang/test/Sema/warn-lifetime-safety-fixits.cpp
+6-0clang/test/Sema/warn-lifetime-safety-misplaced-lifetimebound-intra-tu.cpp
+153-935 files

LLVM/project 074b6bellvm/test/Transforms/SLPVectorizer/X86 arith-mul-smulo.ll arith-add-saddo.ll

[SLP] Vectorize struct-returning intrinsics

Allow SLP to combine across lanes calls that return a literal struct
(llvm.sincos, llvm.*.with.overflow, llvm.frexp, ...) into a single
call returning a struct of vectors, by widening {T, T, ...} to
{<VF x T>, ...} via VectorTypeUtils and emitting extractvalue +
extractelement for external uses.

Original Pull Request: https://github.com/llvm/llvm-project/pull/195521

Original Pull Request2: https://github.com/llvm/llvm-project/pull/196756

Recommit after revert https://github.com/llvm/llvm-project/pull/198265#event-25652008254

Added check for valid vectorizable type, small corner cases fixes

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/199433
DeltaFile
+549-615llvm/test/Transforms/SLPVectorizer/X86/arith-mul-smulo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-add-saddo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-sub-usubo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-sub-ssubo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-add-uaddo.ll
+429-615llvm/test/Transforms/SLPVectorizer/X86/arith-mul-umulo.ll
+2,774-3,6908 files not shown
+3,775-3,88014 files

LLVM/project fb9c9ebllvm/lib/Target/X86/GISel X86InstructionSelector.cpp, llvm/test/CodeGen/X86/GlobalISel add-scalar.ll sub-scalar.ll

[X86][GISel] Fix carry-in for selectUAddSub. (#199261)

When G_UADDE/G_USUBE was chained off a previous G_UADDE/G_UADDO/
G_USUBE/G_USUBO, selectUAddSub re-materialized EFLAGS.CF from the
previous SETB byte using CMP r, 1. That computes (r - 1) and sets
CF iff r < 1 unsigned, i.e. CF = (r == 0) -- the inverse of the
desired carry. The following ADC/SBB then consumed the wrong CF and
produced an off-by-one upper word; e.g. `add i128 0xFF..FF, 1` under
-global-isel returned hi=0 lo=0 instead of hi=1 lo=0.

Emit NEG r instead: NEG sets CF iff its operand is non-zero, matching
the SETB byte. NEG is a two-address (tied) instruction, so emit it
into a fresh virtual register rather than redefining the carry-in
vreg.

C reproducer (compile on x86_64-linux-gnu and run):

```
  // clang -O2 -fglobal-isel repro.c -o repro && ./repro

    [32 lines not shown]
DeltaFile
+7-6llvm/lib/Target/X86/GISel/X86InstructionSelector.cpp
+5-5llvm/test/CodeGen/X86/GlobalISel/add-scalar.ll
+5-5llvm/test/CodeGen/X86/GlobalISel/sub-scalar.ll
+1-1llvm/test/CodeGen/X86/GlobalISel/select-add-x32.mir
+18-174 files

LLVM/project c0c56f4llvm/test/Transforms/SLPVectorizer/RISCV ordered-reduction.ll

[SLP][NFC] Add precommit test for unprofitable ordered fadd reductions (#199428)

Adds a test case reproducing a scenario where the cost model incorrectly
evaluates an unprofitable ordered fadd reduction chain as profitable.

Further details can be found on this issue:
https://github.com/llvm/llvm-project/issues/199267
DeltaFile
+78-0llvm/test/Transforms/SLPVectorizer/RISCV/ordered-reduction.ll
+78-01 files