LLVM/project 9e3819dclang/lib/ScalableStaticAnalysisFramework/Analyses/EntityPointerLevel EntityPointerLevel.cpp, clang/lib/ScalableStaticAnalysisFramework/Analyses/PointerFlow PointerFlowExtractor.cpp

[SSAF] Increase Expr kind coverage in EntityPointerLevelTranslator

Add support for more kinds of Expr that can be translated to
EntityPointerLevel(s).

Additionally, fix bugs in PointerFlowExtractor discovered by tests
added for the new Expr kinds.
DeltaFile
+114-0clang/unittests/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage/UnsafeBufferUsageTest.cpp
+101-8clang/lib/ScalableStaticAnalysisFramework/Analyses/EntityPointerLevel/EntityPointerLevel.cpp
+67-0clang/unittests/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowTest.cpp
+9-6clang/lib/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowExtractor.cpp
+291-144 files

LLVM/project 34e25e7clang/lib/CIR/Dialect/Transforms FlattenCFG.cpp, clang/test/CIR/CodeGen cleanup-scope-goto-within.cpp

[CIR] Allow local goto within cleanup regions (#197539)

Until now, CIR's FlattenCFG pass reported an NYI error any time a goto
operation was found within a cleanup scope region. This change loosens
that restriction to allow goto operations that transfer to another block
within the same cleanup region. This case doesn't require any change in
the cleanup scope flattening. It just has to be detected and ignored.
The goto will be lowered as it is when no cleanup scope is present.

We are still reporting an NYI error in cases where a goto operation
branches out of the cleanup scope. That will be implemented in a
follow-up change.

Assisted-by: Cursor / claude-opus-4.7-thinking-xhigh
DeltaFile
+166-0clang/test/CIR/CodeGen/cleanup-scope-goto-within.cpp
+110-0clang/test/CIR/Transforms/flatten-cleanup-scope-simple.cir
+50-14clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
+6-4clang/test/CIR/Transforms/flatten-cleanup-scope-nyi.cir
+332-184 files

LLVM/project 6872c74mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-simd-linear.mlir

Fix regressions in OpenMP V&V and Fujitsu testsuites

The users iterator apparently becomes invalid after one of its uses is
replaced. Fix this by making a copy of the list of users.
DeltaFile
+52-4mlir/test/Target/LLVMIR/openmp-simd-linear.mlir
+2-1mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+54-52 files

LLVM/project 8be54bfflang/lib/Lower/OpenMP DataSharingProcessor.cpp, flang/test/Lower/OpenMP composite_simd_linear.f90 distribute-parallel-do-simd.f90

Reland "[flang][OpenMP] Fix lowering of LINEAR iteration variables (#188851)"

Linear iteration variables were being treated as private. This fixes
one of the issues reported in #170784.

The regressions in the OpenMP V&V and Fujitsu testsuites happened
because the users iterator was apparently becoming invalid, after one of
its uses was replaced. This was fixed by making a copy of the list of
users.
DeltaFile
+47-17mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+22-17flang/test/Lower/OpenMP/composite_simd_linear.f90
+34-0mlir/test/Target/LLVMIR/openmp-simd-linear.mlir
+12-13flang/test/Lower/OpenMP/distribute-parallel-do-simd.f90
+8-5flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
+5-5flang/test/Lower/OpenMP/loop-pointer-variable.f90
+128-575 files not shown
+144-7011 files

LLVM/project fee14fellvm/lib/Transforms/Vectorize VPlanRecipes.cpp

[VPlan] Simplify and strengthen Replicate::execute (NFC) (#196055)
DeltaFile
+13-45llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+13-451 files

LLVM/project 0fc922fflang/include/flang/Optimizer/Support InternalNames.h, flang/lib/Optimizer/Support InternalNames.cpp

[flang] Exclude procedure scope variables in isModuleScopeDataUniquedName  (#192999)

In particular, for saved local such as `x` in the sample below,
isModuleScopeDataUniquedName should return false.
```
module m
contains
    subroutine foo()
      integer, save :: x ! <-- SAVE
    end subroutine
end
```
DeltaFile
+18-3flang/unittests/Optimizer/InternalNamesTest.cpp
+4-1flang/lib/Optimizer/Support/InternalNames.cpp
+3-1flang/include/flang/Optimizer/Support/InternalNames.h
+25-53 files

LLVM/project 77e4b82clang/include/clang/CIR/Dialect/Transforms CIRTransformUtils.h, clang/lib/CIR/Dialect/Transforms CXXABILowering.cpp CIRTransformUtils.cpp

[CIR] Make collectUnreachable more robust (#197334)

The CXXABILowering and LowerToLLVM passes both use a
`collectUnreachable` function to find unreachable blocks and add them to
a SmallVector that will be passed to `applyPartialConversion` to avoid
leaving unconverted operations in the dead blocks. We can't simply call
`eraseUnreachableBlocks` because we don't yet protect indirect branch
and goto targets from being erased.

Application testing revealed that our `collectUnreachable` function was
missing blocks in SCCs, because they were connected to each other. This
change revises `collectUnreachable` to instead build a list of reachable
blocks and then walk all blocks to find the ones that aren't in the
reachable list (which is what `eraseUnreachableBlocks` does).

Assisted-by: Cursor / claude-opus-4.7-thinking-xhigh
DeltaFile
+2-66clang/lib/CIR/Dialect/Transforms/CXXABILowering.cpp
+2-65clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+44-0clang/include/clang/CIR/Dialect/Transforms/CIRTransformUtils.h
+36-1clang/lib/CIR/Dialect/Transforms/CIRTransformUtils.cpp
+0-35clang/lib/CIR/Dialect/Transforms/CIRTransformUtils.h
+34-0clang/test/CIR/CodeGen/unreachable-cycle.c
+118-1673 files not shown
+121-1699 files

LLVM/project 1ca8b60clang/lib/Sema SemaChecking.cpp, clang/test/SemaCXX attr-lifetime-capture-by.cpp

[LifetimeSafety] Fix a crash on calling a function with `lifetime_capture_by` with an invalid parameter (#197517)

On creating the attribute, all of the parameters are in an invalid
state. If later not replaced (with a valid argument, such as `global`,
`this`, or any variable), the code will iterate over what it assumes are
completely valid arguments.

With this PR we just skip the argument handling for the invalid ones.

Fixes #197508
DeltaFile
+2-0clang/lib/Sema/SemaChecking.cpp
+2-0clang/test/SemaCXX/attr-lifetime-capture-by.cpp
+4-02 files

LLVM/project 5e6484aclang/lib/Analysis/LifetimeSafety Checker.cpp, clang/test/Sema warn-lifetime-safety-lifetimebound.cpp

[LifetimeSafety] Fix a crash in lifetimbound verification on assignment methods  (#197551)

The problem was that `implicitObjectParamIsLifetimeBound` could also
return true if the function we are analyzing is an assignment operator
with a few conditions.

https://github.com/llvm/llvm-project/blob/67284454ae951d1c9702f0ac784447eede59386d/clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp#L33-L49

Since there would be nowhere to extract the attribute from nonetheless,
I think we should ignore that check.
DeltaFile
+14-1clang/test/Sema/warn-lifetime-safety-lifetimebound.cpp
+1-1clang/lib/Analysis/LifetimeSafety/Checker.cpp
+15-22 files

LLVM/project 65f8a7cclang-tools-extra/clang-doc BitcodeReader.cpp Serialize.cpp, clang-tools-extra/unittests/clang-doc SerializeTest.cpp MergeTest.cpp

Reapply "[clang-doc] Move Info types into arenas (#190054)" (#192495)

This base patch was reverted to unbreak darwin-x86 bots. This version
of the patch avoids allocating any Info types locally and copying them 
into the arenas after. It also uses a dedicated InfoNode<T> to manage
data separately from the lists, since the list nodes themselves were
being corrupted. The perf numbers below are not quite accurate anymore,
but are in the same ballpark.

Co-authored-by: Erick Velez <erickvelez7 at gmail.com>

---
Original PR text:

Info types used to own significant chunks of data. As we move these into
local arenas, these types must be trivially destructible, to avoid
leaking resources when the arena is reset. Unfortunately, there isn't a
good way to transition all the data types one at a time, since most of
them are tied together in some way. Further, as they're now allocated in

    [66 lines not shown]
DeltaFile
+469-190clang-tools-extra/clang-doc/BitcodeReader.cpp
+278-191clang-tools-extra/unittests/clang-doc/SerializeTest.cpp
+237-131clang-tools-extra/unittests/clang-doc/MergeTest.cpp
+196-141clang-tools-extra/clang-doc/Serialize.cpp
+186-116clang-tools-extra/clang-doc/Representation.h
+176-80clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
+1,542-84915 files not shown
+2,087-1,12621 files

LLVM/project c0110aaclang/lib/Sema SemaDeclCXX.cpp, clang/test/AST ast-dump-invalid.cpp

[clang] fix crash on alias templates with extraneous template parameter lists (#197542)

Recovers by picking a non-empty template parameter list as the current
list.

This fixes a regression introduced by #195303, which has never been
released, so there are no release notes.

Fixes #197398
DeltaFile
+10-1clang/lib/Sema/SemaDeclCXX.cpp
+7-0clang/test/SemaTemplate/alias-templates.cpp
+1-1clang/test/AST/ast-dump-invalid.cpp
+18-23 files

LLVM/project 9b5c3afllvm/lib/Transforms/Vectorize VPlanRecipes.cpp

[VPlan] Remove unneeded setDebugLoc in ::execute (NFC) (#197552)

The debug location is set before each recipe's ::execute is called.
Remove unneeded setDebugLoc in executes.
DeltaFile
+0-2llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+0-21 files

LLVM/project 31ad6c3llvm/lib/Target/AMDGPU/MCTargetDesc AMDGPUMCExpr.cpp AMDGPUMCCodeEmitter.cpp, llvm/test/MC/AMDGPU literals.s

[AMDGPU] Fix forced lit64 encoding on lit() modifier

We were forcing lit64 encoding on a 64-bit operand with lit()
modifier. This is not required, not compatible with SP3, and
in the pathalogical case creates invalid 4 dword encoding if
used with a VOP3* instruction.

That said if lit() is used the immediate is silently truncated
even before the encoding, so the encoder only sees 32-bits of
relevant data and 32-bits of zeroes anyway. That is a separate
issue, but we never had a true 64-bit constant really properly
encoded with lit() modifier, only with lit64().
DeltaFile
+76-10llvm/test/MC/AMDGPU/literals.s
+7-0llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.cpp
+2-1llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.cpp
+2-0llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.h
+1-1llvm/test/MC/Disassembler/AMDGPU/literals.txt
+88-125 files

LLVM/project bae6c2ellvm/test/Transforms/LoopVectorize epilog-iv-select-cmp.ll, llvm/test/Transforms/LoopVectorize/AArch64 epilogue-vectorization-fix-scalar-resume-values.ll

[LV] Add extra tests for epilogue vectorization. (NFC) (#197283)

Add additional tests with dead main epilogue loops and various
interesting combinations: SCEV and memory runtime checks, various
reductions etc.
DeltaFile
+452-159llvm/test/Transforms/LoopVectorize/epilog-iv-select-cmp.ll
+266-1llvm/test/Transforms/LoopVectorize/AArch64/epilogue-vectorization-fix-scalar-resume-values.ll
+718-1602 files

LLVM/project 3b6b150llvm/docs/TableGen ProgRef.rst, llvm/test/TableGen sort.td

rebase

Created using spr 1.3.7
DeltaFile
+5-4llvm/test/TableGen/sort.td
+2-0llvm/docs/TableGen/ProgRef.rst
+7-42 files

LLVM/project 1fe76c8llvm/docs/TableGen ProgRef.rst, llvm/test/TableGen sort.td

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+5-4llvm/test/TableGen/sort.td
+2-0llvm/docs/TableGen/ProgRef.rst
+7-42 files

LLVM/project 6aca4cdllvm/docs/TableGen ProgRef.rst, llvm/test/TableGen sort.td

review comments, give rst a code block

Created using spr 1.3.7
DeltaFile
+5-4llvm/test/TableGen/sort.td
+2-0llvm/docs/TableGen/ProgRef.rst
+7-42 files

LLVM/project e343e09flang-rt/lib/cuda memory.cpp, flang-rt/unittests/Runtime/CUDA Memory.cpp

[flang][cuda] Optimize CUDA descriptor transfers for regular strided layouts (#197532)

Add a conservative cudaMemcpy2D fast path for descriptor-to-descriptor
CUDA transfers when both descriptors have equal element counts and
regular positive-stride layouts. This speeds up cases such as
component-section transfers while preserving the existing runtime Assign
fallback for unsupported layouts, and adds CUDA runtime coverage for
strided host/device descriptor copies.
DeltaFile
+103-0flang-rt/lib/cuda/memory.cpp
+58-0flang-rt/unittests/Runtime/CUDA/Memory.cpp
+161-02 files

LLVM/project 9861a54llvm/lib/Target/RISCV RISCVISelDAGToDAG.cpp RISCVInstrInfoP.td, llvm/test/CodeGen/RISCV rvp-simd-64.ll

[RISCV][P-ext] Add splat_vector for 64-bit vectors on RV32. (#197345)
DeltaFile
+17-89llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+57-46llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+12-3llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+1-0llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+87-1384 files

LLVM/project f230e44libclc/clc/lib/amdgpu/subgroup clc_sub_group_scan.inc clc_amdgpu_permlanex16.inc

[libclc] Add optimized DPP scan functions for AMDGPU (#197543)

Summary:
This uses the update_dpp function to efficiently provide scans. DPP
allows for swizzling within a group of 16, so we do four of those,
followed by a permlane on GFX10, or a native DPP shift on GFX9.

 Right now these are not actually used because we do not compile for
 multiple targets yet, but I verified them by setting
 `CMAKE_CLC_FLAGS=mcpu=gfx1030` or similar. The intention is to have
 these waiting as a motivational implementation once we start doing
 variable builds.

 The output is optimal as far as I am aware. Here is the example for
 gfx1030 generation:

 ```asm
_Z28sub_group_scan_inclusive_addi: ; @_Z28sub_group_scan_inclusive_addi
; %bb.0:

    [17 lines not shown]
DeltaFile
+54-0libclc/clc/lib/amdgpu/subgroup/clc_sub_group_scan.inc
+46-0libclc/clc/lib/amdgpu/subgroup/clc_amdgpu_permlanex16.inc
+15-0libclc/clc/lib/amdgpu/subgroup/clc_sub_group_scan.cl
+115-03 files

LLVM/project c01ca98llvm/lib/Transforms/Vectorize VPlanRecipes.cpp VPlanHelpers.h

[VPlan] Remove VPTransformState::Lane (NFC). (#197545)

After efd429fdfb6f, all replicate regions are dissolved early. Remove
the new unused VPTransformState::Lane and corresponding dead assertions.
DeltaFile
+0-7llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+0-6llvm/lib/Transforms/Vectorize/VPlanHelpers.h
+0-2llvm/lib/Transforms/Vectorize/VPlan.cpp
+0-153 files

LLVM/project 7a48e68llvm/lib/Transforms/Utils LoopUnroll.cpp

Add inits and assert
DeltaFile
+4-1llvm/lib/Transforms/Utils/LoopUnroll.cpp
+4-11 files

LLVM/project 52950b8clang/docs ReleaseNotes.rst, clang/lib/Sema SemaTemplateInstantiate.cpp SemaExprCXX.cpp

[clang] make evaluation of type constraint a SFINAE context

Otherwise, errors when substituting a type constraint could unintentionally make
the program ill-formed.

This also strenghtens the assert which checks, when we are instantiating templates,
that we either have a code synthesis context, or that we are in a SFINAE
context.
DeltaFile
+12-32clang/lib/Sema/SemaTemplateInstantiate.cpp
+21-0clang/test/SemaTemplate/instantiate-requires-expr.cpp
+4-0clang/lib/Sema/SemaExprCXX.cpp
+2-0clang/docs/ReleaseNotes.rst
+39-324 files

LLVM/project ccf1b48clang/include/clang/ScalableStaticAnalysisFramework/Analyses/PointerFlow PointerFlowAnalysis.h, clang/include/clang/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage UnsafeBufferUsageAnalysis.h

[NFC][SSAF] Rename PointerFlowReachableAnalysis to UnsafeBufferReachableAnalysis

The previously named PointerFlowReachableAnalysis essentially
propagates unsafe buffers across a pointer flow graph. The pointer
flow analysis is a dependency rather than the subject
itself. Therefore, this commit renames and moves the analysis to
better reflect its purpose.
DeltaFile
+3-113clang/lib/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowAnalysis.cpp
+109-0clang/lib/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage/UnsafeBufferUsageAnalysis.cpp
+21-2clang/include/clang/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage/UnsafeBufferUsageAnalysis.h
+0-14clang/include/clang/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowAnalysis.h
+133-1294 files

LLVM/project 6728445clang-tools-extra/clang-tidy/utils DesignatedInitializers.cpp, clang/docs LibASTMatchersReference.html

[clang] Make `InitListExpr::isExplicit()` work (#195175)

The main goal of this change is to be able to use `isExplicit()` check
in the IWYU tool. Consider the following:
```cpp
struct Inner {};

struct Outer {
  Inner inner;
};

const Outer& refOuter = {};
```
Here, Clang generates `InitListExpr` child node for the implicit `Inner`
initialization under the `InitListExpr` node corresponding to the
initializer of `refOuter`. IWYU should require the header containing
`Outer` definition for the initializer, but not the header for `Inner`
because it should be already provided by `Outer`.


    [9 lines not shown]
DeltaFile
+246-3clang/unittests/AST/ASTExprTest.cpp
+58-0clang/docs/LibASTMatchersReference.html
+28-11clang/test/AST/HLSL/matrix-constructors.hlsl
+22-17clang/lib/Sema/SemaInit.cpp
+6-20clang-tools-extra/clang-tidy/utils/DesignatedInitializers.cpp
+24-2clang/include/clang/ASTMatchers/ASTMatchers.h
+384-5323 files not shown
+485-13529 files

LLVM/project cfdf791clang/include/clang/Basic LangOptions.def, clang/include/clang/Options Options.td

[LifetimeSafety] Add `-fdebug-run-lifetime-safety` flag to run analysis without enabling warnings (#197219)
DeltaFile
+4-4clang/include/clang/Options/Options.td
+2-3clang/lib/Sema/AnalysisBasedWarnings.cpp
+3-1clang/lib/Sema/SemaLifetimeSafety.h
+1-1clang/include/clang/Basic/LangOptions.def
+10-94 files

LLVM/project e0fcb61llvm/lib/CodeGen MachineFunction.cpp, llvm/lib/MC MCDwarf.cpp

[AMDGPU][MC] Replace shifted registers in CFI instructions

Change-Id: I0d99e9fe43ec3b6fecac20531119956dca2e4e5c
DeltaFile
+67-67llvm/test/CodeGen/AMDGPU/sgpr-spill-overlap-wwm-reserve.mir
+30-0llvm/lib/MC/MCDwarf.cpp
+15-15llvm/test/CodeGen/AMDGPU/dwarf-multi-register-use-crash.ll
+14-0llvm/lib/CodeGen/MachineFunction.cpp
+4-4llvm/test/CodeGen/AMDGPU/debug-frame.ll
+2-2llvm/test/CodeGen/AMDGPU/pei-vgpr-block-spill-csr.mir
+132-885 files not shown
+145-9011 files

LLVM/project ddc973allvm/lib/Target/AMDGPU SIFrameLowering.cpp SIMachineFunctionInfo.h, llvm/test/CodeGen/AMDGPU amdgpu-spill-cfi-saved-regs.ll

[AMDGPU] Implement -amdgpu-spill-cfi-saved-regs

These spills need special CFI anyway, so implementing them directly
where CFI is emitted avoids the need to invent a mechanism to track them
from ISel.

Change-Id: If4f34abb3a8e0e46b859a7c74ade21eff58c4047
Co-authored-by: Scott Linder scott.linder at amd.com
Co-authored-by: Venkata Ramanaiah Nalamothu VenkataRamanaiah.Nalamothu at amd.com
DeltaFile
+2,926-0llvm/test/CodeGen/AMDGPU/amdgpu-spill-cfi-saved-regs.ll
+12-0llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+10-0llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+9-0llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+2-0llvm/lib/Target/AMDGPU/SIRegisterInfo.h
+2,959-05 files

LLVM/project b11e4fblld/MachO Driver.cpp, lld/test/MachO read-workers-order.s read-workers-order-obj.s

[lld][MachO] Fix symbol resolution order with --read-workers (#193239)

When read-workers is enabled, archives are deferred while
frameworks and dylibs are processed immediately. This can cause
incorrect resolution if dylib's symbols are inserted into the
symbol table before an archive's lazy-symbols.

This also fixes Chromium bug crbug.com/500256589 whose root cause
was due to this incorrect resolution of dylib symbols being
inserted too soon.

This patch now defers all library and framework types.
`ArchiveFile::addLazySymbols()` is also called immediately after
each archive is created in the processing loop.

---------

Co-authored-by: Nico Weber <thakis at chromium.org>
DeltaFile
+99-72lld/MachO/Driver.cpp
+39-0lld/test/MachO/read-workers-order.s
+38-0lld/test/MachO/read-workers-order-obj.s
+176-723 files

LLVM/project 5f7170dllvm/lib/Analysis GlobalsModRef.cpp ConstantFolding.cpp

[NFC][Analysis] Use `isa<ConstantPointerNull>` for null pointer checks

Make Analysis null pointer checks use `ConstantPointerNull` rather than generic
null value checks.
DeltaFile
+3-2llvm/lib/Analysis/GlobalsModRef.cpp
+2-2llvm/lib/Analysis/ConstantFolding.cpp
+1-1llvm/lib/Analysis/LazyValueInfo.cpp
+6-53 files