LLVM/project 12d0672clang/lib/CIR/Dialect/Transforms FlattenCFG.cpp, clang/test/CIR/Transforms flatten-cleanup-scope-simple.cir flatten-cleanup-scope-multi-exit.cir

[CIR] Implement initial flattening of cleanup scope ops (#180063)

This implements flattening of `cir.cleanup.scope` operations that have a
single exit, and introduces checks to detect multiple exit cases and
report an error when they are encountered. At this point, only normal
cleanups are flattened. EH cleanup handling will be added in a future
change.

Substantial amounts of this PR were created using agentic AI tools, but
I have carefully reviewed the code, comments, and tests and made changes
as needed.
DeltaFile
+540-0clang/test/CIR/Transforms/flatten-cleanup-scope-simple.cir
+413-0clang/test/CIR/Transforms/flatten-cleanup-scope-multi-exit.cir
+326-4clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
+59-0clang/test/CIR/Transforms/flatten-cleanup-scope-nyi.cir
+1,338-44 files

LLVM/project 66020a7clang/lib/CodeGen CGObjCMac.cpp

format
DeltaFile
+3-6clang/lib/CodeGen/CGObjCMac.cpp
+3-61 files

LLVM/project 4d6913elibcxx/include/__vector vector.h

[libcxx] Rename `__split_buffer` alias template to `_SplitBuffer` (#180284)

`-Wchanges-meaning` is a GCC warning that catches shadowing in more
contexts. While a bit annoying here, it's a helpful warning. As such, we
need to rename the `__split_buffer` alias template in `std::vector` so
that we don't trip it up.
DeltaFile
+20-23libcxx/include/__vector/vector.h
+20-231 files

LLVM/project 047db15clang/test/OpenMP task_codegen.cpp threadprivate_codegen.cpp

Revert "[Clang] Mark this pointer in destructors dead_on_return (#166276)"

This reverts commit 278fd0553ef5834e005a048a6b480631f3fc1b38.

This was causing some buildbot failures in DSE:
1. https://lab.llvm.org/buildbot/#/builders/25/builds/15425
2. https://lab.llvm.org/buildbot/#/builders/24/builds/17304
DeltaFile
+2,041-3,458clang/test/OpenMP/task_codegen.cpp
+2,140-2,140clang/test/OpenMP/threadprivate_codegen.cpp
+514-514clang/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp
+510-510clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
+311-647clang/test/OpenMP/for_reduction_codegen.cpp
+455-455clang/test/OpenMP/single_codegen.cpp
+5,971-7,72493 files not shown
+13,769-15,65399 files

LLVM/project 3213d9dclang/include/clang/CodeGen CodeGenABITypes.h, clang/lib/CodeGen CGObjCMac.cpp

expose getObjCDirectMethodCallee for swift

Swift may need to emit calls to thunks as well. Instead
of letting swift rewrite the thunk generation logic, we
might as well expose the method.
DeltaFile
+19-0clang/lib/CodeGen/CGObjCMac.cpp
+15-0clang/include/clang/CodeGen/CodeGenABITypes.h
+34-02 files

LLVM/project 8102ebfmlir/lib/Dialect/XeGPU/Transforms XeGPULayoutImpl.cpp

[MLIR][XeGPU] Fixing PR179016 minor issues (#180295)

Fix two issues brough by PR179016: 
1. unused variable if build the option with
"DLLVM_ENABLE_ASSERTIONS=OFF"
2. Recover modification to recoverTemporaryLayouts() brought by
PR176737. Unintentionally lost during the merging process.
DeltaFile
+4-4mlir/lib/Dialect/XeGPU/Transforms/XeGPULayoutImpl.cpp
+4-41 files

LLVM/project f7aa1cdclang/lib/Frontend FrontendAction.cpp, clang/lib/Serialization ASTWriter.cpp

[clang] Canonicalizing `-include-pch` input in the Frontend (#180065)

This patch adds logic to canonicalize `-include-pch`'s input in the
frontend. This way, the `ASTWriter` always serializes the canonicalized
path to the included pch file whether the input is an absolute path or a
relative path.

Fixes rdar://168596546.
DeltaFile
+29-0clang/test/PCH/pch-input-path-independent.c
+12-3clang/lib/Frontend/FrontendAction.cpp
+9-0clang/lib/Serialization/ASTWriter.cpp
+1-1clang/test/Modules/validate-file-content.m
+2-0clang/test/PCH/debug-info-pch-path.c
+1-1clang/test/PCH/modified-module-dependency.m
+54-51 files not shown
+55-67 files

LLVM/project 2555f3bclang/include/clang/Analysis/Analyses/LifetimeSafety LifetimeAnnotations.h, clang/lib/Analysis/LifetimeSafety LifetimeAnnotations.cpp FactsGenerator.cpp

[LifetimeSafety] Treat std::unique_ptr::release() as a move operation (#180230)

Add support for `std::unique_ptr::release()` in lifetime analysis to
avoid false positives when ownership is manually transferred via
`release()`.

- Added a new function `isUniquePtrRelease()` to detect when
`std::unique_ptr::release()` is called
- Modified `handleInvalidatingCall()` to mark the unique_ptr as moved
when release() is called

When manually transferring ownership using `std::unique_ptr::release()`,
the lifetime analysis would previously generate false positive
use-after-free warnings. This change treats `release()` as a move
operation, correctly modeling the ownership transfer semantics and
reducing false positives in code that manually manages ownership.
DeltaFile
+18-8clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+14-1clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+12-0clang/test/Sema/warn-lifetime-safety.cpp
+5-0clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
+1-0clang/test/Sema/Inputs/lifetime-analysis.h
+50-95 files

LLVM/project 249bf83clang/unittests/Analysis CFGBackEdgesTest.cpp, llvm/lib/CAS OnDiskGraphDB.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+1,790-1,17459 files not shown
+2,639-1,65665 files

LLVM/project 184b51fclang/unittests/Analysis CFGBackEdgesTest.cpp, llvm/lib/CAS OnDiskGraphDB.cpp

reb

Created using spr 1.3.7
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+1,790-1,17459 files not shown
+2,639-1,65665 files

LLVM/project bb1bde3clang/unittests/Analysis CFGBackEdgesTest.cpp, llvm/lib/CAS OnDiskGraphDB.cpp

reb

Created using spr 1.3.7
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+1,790-1,17459 files not shown
+2,639-1,65665 files

LLVM/project 278fd05clang/test/OpenMP task_codegen.cpp threadprivate_codegen.cpp

[Clang] Mark this pointer in destructors dead_on_return (#166276)

This helps to clean up any dead stores that come up at the end of the
destructor. The motivating example was a refactoring in libc++'s
basic_string implementation in 8dae17be2991cd7f0d7fd9aa5aecd064520a14f6
that added a zeroing store into the destructor, causing a large
performance regression on an internal workload. We also saw a ~0.2%
performance increase on an internal server workload when enabling this.

I also tested this against all of the non-flaky tests in our large C++
codebase and found a minimal number of issues that all happened to be in
user code.
DeltaFile
+3,458-2,041clang/test/OpenMP/task_codegen.cpp
+2,140-2,140clang/test/OpenMP/threadprivate_codegen.cpp
+514-514clang/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp
+510-510clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
+652-316clang/test/OpenMP/for_reduction_codegen.cpp
+455-455clang/test/OpenMP/single_codegen.cpp
+7,729-5,97693 files not shown
+15,658-13,77499 files

LLVM/project bd40e5eclang/unittests/Analysis CFGBackEdgesTest.cpp, llvm/lib/CAS OnDiskGraphDB.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+1,790-1,17459 files not shown
+2,639-1,65665 files

LLVM/project 474ecf9clang/unittests/Analysis CFGBackEdgesTest.cpp, llvm/lib/CAS OnDiskGraphDB.cpp

cmt

Created using spr 1.3.7
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+1,790-1,17459 files not shown
+2,639-1,65665 files

LLVM/project 0bc4b45clang/unittests/Analysis CFGBackEdgesTest.cpp, llvm/lib/CAS OnDiskGraphDB.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+1,790-1,17459 files not shown
+2,638-1,65465 files

LLVM/project 71a8973mlir/include/mlir/Bindings/Python IRAttributes.h, mlir/lib/Bindings/Python IRAffine.cpp IRInterfaces.cpp

[MLIR][Python] Remove partial LLVM APIs in python bindings (4/n)  (#180256)

This PR continues work from #178290 
It replaces some LLVM utilities with straightforward `std::`
equivalents.
DeltaFile
+25-36mlir/lib/Bindings/Python/IRAffine.cpp
+26-28mlir/lib/Bindings/Python/IRInterfaces.cpp
+20-23mlir/lib/Bindings/Python/IRAttributes.cpp
+13-17mlir/lib/Bindings/Python/Globals.cpp
+6-5mlir/include/mlir/Bindings/Python/IRAttributes.h
+4-5mlir/lib/Bindings/Python/IRTypes.cpp
+94-1143 files not shown
+100-1229 files

LLVM/project be18ac8llvm/lib/Target/SPIRV SPIRVGlobalRegistry.cpp, llvm/test/CodeGen/SPIRV memset-large-size.ll

[SPIRV] Fix APInt overflow in memset constant array creation (#180189)

In getOrCreateConstIntArray(), the cache UniqueKey encoded the array
size (Num) using the array element type (e.g. i8 for memset). Since Num
is a size_t that can exceed 255, this caused an APInt overflow when Num
> 255. Use i64 for Num in the UniqueKey.
DeltaFile
+22-0llvm/test/CodeGen/SPIRV/memset-large-size.ll
+2-1llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+24-12 files

LLVM/project 9e355c8llvm/include/llvm/IR IntrinsicsSPIRV.td, llvm/lib/Target/SPIRV SPIRVEmitIntrinsics.cpp SPIRVLegalizePointerCast.cpp

[SPIRV] Fix alignment overflow in memory intrinsics (#180184)

Per SPIR-V spec alignment is 32-bit integer, so it should be encoded as
i8 in the intrinsics'
def.
DeltaFile
+21-0llvm/test/CodeGen/SPIRV/memory-inst-large-align.ll
+4-4llvm/include/llvm/IR/IntrinsicsSPIRV.td
+4-4llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+1-1llvm/lib/Target/SPIRV/SPIRVLegalizePointerCast.cpp
+30-94 files

LLVM/project b74f8adclang/unittests/Analysis/FlowSensitive UncheckedStatusOrAccessModelTestFixture.cpp

[NFC] [FlowSensitive] [StatusOr] Add tests for member accesses



Reviewers: jvoung

Reviewed By: jvoung

Pull Request: https://github.com/llvm/llvm-project/pull/180077
DeltaFile
+113-0clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp
+113-01 files

LLVM/project 1c3ed97clang/unittests/Analysis/FlowSensitive UncheckedStatusOrAccessModelTestFixture.cpp

address comment

Created using spr 1.3.7
DeltaFile
+0-7clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp
+0-71 files

LLVM/project b2f7508llvm/utils/gn/secondary/clang/lib/Analysis BUILD.gn, llvm/utils/gn/secondary/clang/unittests/Analysis BUILD.gn

[gn build] Port ec15bddde5cb
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/Analysis/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/unittests/Analysis/BUILD.gn
+2-02 files

LLVM/project 649c6bcllvm/utils/gn/secondary/llvm/lib/TargetParser BUILD.gn

[gn build] Port eff21afae01f
DeltaFile
+0-1llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn
+0-11 files

LLVM/project d4d53b0llvm/utils/gn/secondary/llvm/lib/Target/Hexagon BUILD.gn

[gn build] Port 66f9ffbb2c28
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn
+1-01 files

LLVM/project 9fe8e8bllvm/utils/gn/secondary/llvm/lib/CAS BUILD.gn, llvm/utils/gn/secondary/llvm/unittests/CAS BUILD.gn

[gn build] Port 60ecb3789606
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/CAS/BUILD.gn
+1-0llvm/utils/gn/secondary/llvm/unittests/CAS/BUILD.gn
+2-02 files

LLVM/project f98893dllvm/utils/gn/secondary/llvm/lib/Target/Hexagon BUILD.gn

[gn build] Port 28042a87022b
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn
+1-01 files

LLVM/project ec15bddclang/include/clang/Analysis CFGBackEdges.h, clang/lib/Analysis CFGBackEdges.cpp CMakeLists.txt

[clang][analysis][dataflow] Detect goto backedges to trigger Widen (#179546)

Currently, the Clang Dataflow Framework only does Widen on backedges
from structured loops.

Missing some Widen calls (e.g., when there are backedges from gotos)
could cause some analyses to iterate ~forever (until the max visits
limit is hit).

This adds a simple search for backedges, and triggers Widen on the
additional backedge nodes. Fixes [issue 179083.
](https://github.com/llvm/llvm-project/issues/179083)
DeltaFile
+312-0clang/unittests/Analysis/CFGBackEdgesTest.cpp
+105-0clang/lib/Analysis/CFGBackEdges.cpp
+62-5clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
+54-0clang/include/clang/Analysis/CFGBackEdges.h
+8-11clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
+1-0clang/lib/Analysis/CMakeLists.txt
+542-161 files not shown
+543-167 files

LLVM/project 60ecb37llvm/include/llvm/CAS OnDiskGraphDB.h, llvm/lib/CAS OnDiskGraphDB.cpp BuiltinObjectHasher.cpp

 [llvm/CAS] Add file-based APIs to `OnDiskGraphDB` (#179782)

These allow performing optimizations that reduce I/O and disk space
consumption. For example, when applicable, a file can be cloned directly
into the database directory, instead of needing to load it in memory and
then copy its contents into a new file.

These APIs are then used to optimize importing data from an upstream DB
by using file cloning where applicable.
DeltaFile
+222-30llvm/lib/CAS/OnDiskGraphDB.cpp
+208-0llvm/unittests/CAS/OnDiskGraphDBTest.cpp
+51-0llvm/lib/CAS/BuiltinObjectHasher.cpp
+49-0llvm/unittests/CAS/BuiltinObjectHasherTest.cpp
+46-1llvm/include/llvm/CAS/OnDiskGraphDB.h
+15-0llvm/unittests/CAS/OnDiskCommonUtils.h
+591-313 files not shown
+595-319 files

LLVM/project 1bb916cclang/test/CodeGenHLSL matrix-member-one-based-accessor-scalar-load.hlsl matrix-member-zero-based-accessor-scalar-load.hlsl, clang/test/CodeGenHLSL/BasicFeatures MatrixExplicitTruncation.hlsl MatrixImplicitTruncation.hlsl

[HLSL] Represent Matrix as arrays of vectors in memory (#179861)

fixes https://github.com/llvm/llvm-project/issues/179859

For matrix types we need to check the language mode so we can change the
matrix memory layout to arrays of vectors. To make this play nice with
how the rest of clang treats matrices we need to modify the
MaybeConvertMatrixAddress and the CreateMemTemp function to know how to
reconstruct a flattened vector.

Rest of changes is just test updates.
DeltaFile
+16-16clang/test/CodeGenHLSL/matrix-member-one-based-accessor-scalar-load.hlsl
+16-16clang/test/CodeGenHLSL/matrix-member-zero-based-accessor-scalar-load.hlsl
+16-16clang/test/CodeGenHLSL/BasicFeatures/MatrixExplicitTruncation.hlsl
+16-16clang/test/CodeGenHLSL/basic_types.hlsl
+15-15clang/test/CodeGenHLSL/BasicFeatures/MatrixImplicitTruncation.hlsl
+14-14clang/test/CodeGenHLSL/BasicFeatures/MatrixElementTypeCast.hlsl
+93-9310 files not shown
+168-15116 files

LLVM/project 703c276llvm/lib/Analysis IVDescriptors.cpp, llvm/lib/Transforms/Vectorize VPlanConstruction.cpp

Revert "[LV] Support conditional scalar assignments of masked operations" (#180275)

Reverts llvm/llvm-project#178862 

revert to unblock bot:
https://lab.llvm.org/buildbot/#/builders/206/builds/13225
DeltaFile
+0-1,144llvm/test/Transforms/LoopVectorize/AArch64/conditional-scalar-assignment.ll
+0-100llvm/test/Transforms/LoopVectorize/conditional-scalar-assignment-vplan.ll
+0-79llvm/unittests/Analysis/IVDescriptorsTest.cpp
+4-49llvm/lib/Analysis/IVDescriptors.cpp
+2-25llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+9-0llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll
+15-1,3971 files not shown
+16-1,3987 files

LLVM/project 66f9ffbllvm/lib/Target/Hexagon HexagonLiveVariables.cpp HexagonLiveVariables.h, llvm/test/CodeGen/Hexagon nbench1.ll

[Hexagon] Add post-RA live variables analysis (#179531)

This patch adds HexagonLiveVariables, a post-RA liveness analysis for
physical registers, to keep block live-ins/live-outs and operand
kill/dead markers consistent after late Hexagon transforms; it is run
after GenMux in the pre-emit pipeline.

Author: Sergei Larin <slarin at qti.qualcomm.com>
Patch By: Fateme Hosseini <fhossein at qti.qualcomm.com>

Co-authored-by: Sergei Larin <slarin at qti.qualcomm.com>
DeltaFile
+914-0llvm/lib/Target/Hexagon/HexagonLiveVariables.cpp
+134-0llvm/lib/Target/Hexagon/HexagonLiveVariables.h
+77-0llvm/test/CodeGen/Hexagon/live-vars/live-outs.ll
+10-0llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
+3-3llvm/test/CodeGen/Hexagon/isel/mulh-scalar.ll
+2-2llvm/test/CodeGen/Hexagon/nbench1.ll
+1,140-54 files not shown
+1,147-810 files