LLVM/project f5afe7aclang/lib/CodeGen CodeGenFunction.h CGClass.cpp, clang/test/CodeGenCXX microsoft-vector-deleting-dtors2.cpp

[NFC] [Clang] [CodeGen] Reduce code duplication when emitting trap calls (#221022)

There are a number of places in codegen where we do this:
```c++
llvm::CallInst *TrapCall = EmitTrapCall(llvm::Intrinsic::trap);
TrapCall->setDoesNotReturn();
TrapCall->setDoesNotThrow();
Builder.CreateUnreachable();
Builder.ClearInsertionPoint();
```

This patch adds a helper that does this and updates `EmitTrapCall()` to
no longer create a new block after emitting the trap call.

One test had to be updated because an unnecessary block was dropped.
Before, we were generating this:
```llvm
dtor.call_delete_after_array_destroy:             ; preds = %dtor.vector.cont
  call void @llvm.trap() #7

    [6 lines not shown]
DeltaFile
+17-2clang/lib/CodeGen/CGExpr.cpp
+3-15clang/lib/CodeGen/CodeGenFunction.cpp
+2-10clang/lib/CodeGen/CGClass.cpp
+7-3clang/lib/CodeGen/CodeGenFunction.h
+3-3clang/test/CodeGenCXX/microsoft-vector-deleting-dtors2.cpp
+32-335 files

LLVM/project cd316d2llvm/lib/Target/RISCV RISCVInstrInfoZvdot4a8i.td, llvm/test/CodeGen/RISCV/rvv zvdot4a8i-sdnode.ll

[RISCV] Make RISCVISD::VDOT4A_VL/VDOT4AU_VL commutative. (#221051)

Assisted-by: Claude
DeltaFile
+131-0llvm/test/CodeGen/RISCV/rvv/zvdot4a8i-sdnode.ll
+2-2llvm/lib/Target/RISCV/RISCVInstrInfoZvdot4a8i.td
+133-22 files

LLVM/project 08d4996clang/lib/CIR/CodeGen CIRGenExprAggregate.cpp, clang/test/CIR/CodeGen agg-atomic-cast.c

[CIR] Support Aggregate cast from and to atomic type (#220689)

Support Aggregate cast from and to atomic type
DeltaFile
+70-0clang/test/CIR/CodeGen/agg-atomic-cast.c
+33-6clang/lib/CIR/CodeGen/CIRGenExprAggregate.cpp
+103-62 files

LLVM/project c8fbd82clang/docs ReleaseNotes.md, clang/lib/AST Decl.cpp

[Clang][Sema] Add fortify warnings for strlcat (#220341)

Add `-Wfortify-source` diagnostics for `strlcat` and `__builtin_strlcat`
when the size argument exceeds the destination buffer size.

Also add `-Wno-fortify-source` to `clang/test/Analysis/cstring-syntax.c`
to prevent the new compiler diagnostic from interfering with static
analyzer checks on intentionally underflowing test expressions.

Part of #142230

Assisted-by: Gemini
DeltaFile
+5-4clang/test/Analysis/cstring-syntax.c
+6-0clang/test/Sema/warn-fortify-source.c
+5-0clang/docs/ReleaseNotes.md
+3-1clang/lib/Sema/SemaChecking.cpp
+2-1clang/test/Sema/builtins.c
+3-0clang/lib/AST/Decl.cpp
+24-61 files not shown
+25-67 files

LLVM/project 4c44624offload/libompaccsupport PluginManager.cpp device.cpp, offload/libomptarget omptarget.cpp

[offload][omp] Use liboffload queues for memory operations
DeltaFile
+0-90offload/plugins-nextgen/common/src/PluginInterface.cpp
+68-16offload/libompaccsupport/device.cpp
+52-12offload/libompaccsupport/PluginManager.cpp
+10-23offload/libomptarget/OpenMP/API.cpp
+0-31offload/plugins-nextgen/common/include/PluginInterface.h
+25-4offload/libomptarget/omptarget.cpp
+155-1766 files not shown
+188-19212 files

LLVM/project ce6439eclang/lib/Driver Driver.cpp, llvm/lib/Frontend/OpenMP OMPDescriptors.inc

Merge branch 'users/adurango/devinit_liboffload' of https://github.com/llvm/llvm-project into users/adurango/devinit_liboffload
DeltaFile
+0-2,819llvm/lib/Target/Hexagon/HexagonDepMask.h
+2,496-0llvm/test/Transforms/LoopVectorize/PowerPC/partial-red.ll
+517-1,418llvm/test/CodeGen/AArch64/sve-fixed-length-masked-expandloads.ll
+965-342llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
+676-590llvm/lib/Frontend/OpenMP/OMPDescriptors.inc
+67-1,129clang/lib/Driver/Driver.cpp
+4,721-6,2981,358 files not shown
+43,061-23,7511,364 files

LLVM/project c7ba46eclang/lib/Format UnwrappedLineParser.cpp, clang/unittests/Format TokenAnnotatorTest.cpp

[clang-format] Parse ObjC generics in block literal return types (#220995)

The unwrapped line parser handled a block literal's return type as a
single identifier or type keyword followed by optional stars. A return
type carrying ObjC generics or a protocol qualifier, such as
`^NSArray<NSString *> *(int x) { ... }` or `^id<Proto>(int x) { ... }`,
was therefore not recognized as a block, and its body was treated as a
function body instead. This collapsed the body like a short function
and, with `RemoveSemicolon: true`, dropped the semicolon terminating the
enclosing statement, producing code that no longer compiles.

Skip a balanced angle-bracket list after the return type before looking
for the parameter list and body.

Fixes #219713

Assisted-by: Claude Code
DeltaFile
+24-0clang/unittests/Format/TokenAnnotatorTest.cpp
+5-0clang/lib/Format/UnwrappedLineParser.cpp
+29-02 files

LLVM/project 4cb33d6mlir/lib/Dialect/Linalg/Transforms Specialize.cpp

format
DeltaFile
+4-6mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
+4-61 files

LLVM/project 5503333mlir/lib/Dialect/Linalg/Transforms Specialize.cpp, mlir/test/Dialect/Linalg transform-op-specialize-elemwise-binary.mlir decompose-generic-by-unfolding-projected-permutation.mlir

[MLIR][Linalg] Named ops morph cleanup
DeltaFile
+96-98mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
+9-57mlir/test/Dialect/Linalg/specialize-generic-ops.mlir
+1-1mlir/test/Dialect/Linalg/transform-op-specialize-elemwise-binary.mlir
+1-1mlir/test/Dialect/Linalg/decompose-generic-by-unfolding-projected-permutation.mlir
+107-1574 files

LLVM/project 784116cmlir/include/mlir/Dialect/Linalg/IR LinalgNamedStructuredOps.yaml, mlir/lib/Dialect/Linalg/Transforms NamedToElementwise.cpp CategoryToNamedOp.cpp

[MLIR][Linalg] Remove ternary named op

Removes the named op `select` from the Linalg dialect.

I have also updated the ElementwiseOp builder to simplify the default
case: kind + no affine map.

Depends on both unary and binary removal branches.

Ref:
https://discourse.llvm.org/t/rfc-update-semantics-of-linalg-named-operations-unary-binary-ternary/91531
DeltaFile
+0-61mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp
+0-57mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
+0-57mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
+0-48mlir/test/Dialect/Linalg/named-ops.mlir
+0-48mlir/test/Dialect/Linalg/named-ops-fail.mlir
+0-26mlir/test/Dialect/Linalg/generalize-named-ops.mlir
+0-2979 files not shown
+16-37315 files

LLVM/project 4b8839fllvm/test/Transforms/LoopIdiom memmove-ext.ll

[LoopIdiom] Adjust memmove-ext.ll test (#221251)

Some of the functions in this test have an iv value of 0 in the first
iteration which which is then used in a sub nuw which would result in
poison. Adjust these to use 1 in the first iteration.
DeltaFile
+16-14llvm/test/Transforms/LoopIdiom/memmove-ext.ll
+16-141 files

LLVM/project defde18flang/include/flang/Optimizer/Dialect FIROps.td FortranVariableInterface.td, flang/lib/Optimizer/Analysis AliasAnalysis.cpp

[flang][NFC] Add FortranObjectLoadOpInterface for load provenance (#221088)

The definition walk in AliasAnalysis::getSourceImpl already keys the
address half of a descriptor access chain on
FortranObjectViewOpInterface (fir.box_addr, fir.create_box,
fir.convert), but the load step was hardcoded to fir::LoadOp. Any other
operation whose result is a value read from memory therefore terminated
the walk at SourceKind::Unknown, losing the AllocDeref/PointerDeref root
and coarsening alias results for everything reached through the loaded
descriptor.

Add FortranObjectLoadOpInterface as the value-producing dual of
FortranObjectViewOpInterface: a view op forwards an address, a load-like
op yields the value read from one. It declares a single getLoadSource
method reporting the memory reference a result was read from. fir.load
implements it as getMemref(), so this is NFC, and the box-load case in
getSourceImpl now keys on the interface instead of the concrete op.

The interface documents provenance only and makes no purity claim, so an

    [5 lines not shown]
DeltaFile
+43-0flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
+12-4flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
+4-0flang/include/flang/Optimizer/Dialect/FIROps.td
+59-43 files

LLVM/project 21aece2offload/liboffload/src OffloadImpl.cpp

Merge branch 'users/adurango/memops_liboffload' of https://github.com/adurang/llvm-project into users/adurango/memops_liboffload
DeltaFile
+27-5offload/liboffload/src/OffloadImpl.cpp
+27-51 files

LLVM/project f75b587offload/include PluginManager.h, offload/liboffload exports

[offload][omp] Load plugins through liboffload
DeltaFile
+16-11offload/libompaccsupport/PluginManager.cpp
+5-0offload/liboffload/src/OffloadImpl.cpp
+2-1offload/include/PluginManager.h
+1-1offload/liboffload/exports
+24-134 files

LLVM/project 4b841bdoffload/include PluginManager.h, offload/liboffload/API Program.td

[offload][omp] Initialize devices through liboffload
DeltaFile
+119-109offload/libompaccsupport/PluginManager.cpp
+30-0offload/liboffload/src/OffloadImpl.cpp
+9-8offload/libompaccsupport/device.cpp
+0-15offload/plugins-nextgen/common/src/PluginInterface.cpp
+15-0offload/liboffload/API/Program.td
+5-7offload/include/PluginManager.h
+178-1393 files not shown
+183-1509 files

LLVM/project 0a85f45offload/unittests/OffloadAPI/platform olIteratePlatforms.cpp

add test
DeltaFile
+45-0offload/unittests/OffloadAPI/platform/olIteratePlatforms.cpp
+45-01 files

LLVM/project 732ce23offload/liboffload/API Platform.td, offload/liboffload/src OffloadImpl.cpp

[OFFLOAD]add olIteratePlatforms
DeltaFile
+23-0offload/liboffload/API/Platform.td
+11-0offload/liboffload/src/OffloadImpl.cpp
+34-02 files

LLVM/project b6ad182offload/liboffload/src OffloadImpl.cpp

[OFFLOAD] Initialize Platforms and Devices lazily
DeltaFile
+226-82offload/liboffload/src/OffloadImpl.cpp
+226-821 files

LLVM/project ecc14a4offload/liboffload exports, offload/liboffload/src OffloadImpl.cpp

[offload][omp] link libomptarget against liboffload
DeltaFile
+58-0offload/liboffload/exports
+9-3offload/liboffload/src/OffloadImpl.cpp
+5-5offload/libomptarget/CMakeLists.txt
+6-0offload/libomptarget/exports
+3-0offload/libomptarget/interface.cpp
+81-85 files

LLVM/project 2186cfboffload/liboffload/src OffloadImpl.cpp

don't initialize devices when validating the image
DeltaFile
+1-5offload/liboffload/src/OffloadImpl.cpp
+1-51 files

LLVM/project cdea218offload/liboffload/src OffloadImpl.cpp

Merge branch 'users/adurango/devinit_liboffload' of https://github.com/adurang/llvm-project into users/adurango/devinit_liboffload
DeltaFile
+27-5offload/liboffload/src/OffloadImpl.cpp
+27-51 files

LLVM/project 278ea91mlir/include/mlir/Dialect/Linalg/IR LinalgNamedStructuredOps.yaml, mlir/python/mlir/dialects/linalg/opdsl/ops core_named_ops.py

[MLIR][Linalg] Remove binary named ops

Remove ops, change tests to elementwise to continue working as is.

Depends on the unary removal branch.

Ref:
https://discourse.llvm.org/t/rfc-update-semantics-of-linalg-named-operations-unary-binary-ternary/91531
DeltaFile
+0-395mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
+0-272mlir/test/Dialect/Linalg/named-ops.mlir
+0-202mlir/test/Dialect/Linalg/generalize-named-ops.mlir
+0-160mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-named-ops.mlir
+0-155mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
+33-105mlir/test/Dialect/Linalg/specialize-generic-ops.mlir
+33-1,28924 files not shown
+235-1,86530 files

LLVM/project 9971ff0offload/libompaccsupport PluginManager.cpp device.cpp, offload/libomptarget omptarget.cpp

[offload][omp] Use liboffload queues for memory operations
DeltaFile
+0-90offload/plugins-nextgen/common/src/PluginInterface.cpp
+68-16offload/libompaccsupport/device.cpp
+52-12offload/libompaccsupport/PluginManager.cpp
+10-23offload/libomptarget/OpenMP/API.cpp
+0-31offload/plugins-nextgen/common/include/PluginInterface.h
+25-4offload/libomptarget/omptarget.cpp
+155-1766 files not shown
+188-19212 files

LLVM/project 236bf82offload/include PluginManager.h, offload/liboffload/API Program.td

[offload][omp] Initialize devices through liboffload
DeltaFile
+119-109offload/libompaccsupport/PluginManager.cpp
+30-0offload/liboffload/src/OffloadImpl.cpp
+9-8offload/libompaccsupport/device.cpp
+0-15offload/plugins-nextgen/common/src/PluginInterface.cpp
+15-0offload/liboffload/API/Program.td
+5-7offload/include/PluginManager.h
+178-1393 files not shown
+183-1509 files

LLVM/project a91e909

[offload][omp] Load plugins through liboffload
DeltaFile
+0-00 files

LLVM/project cf68ec1offload/include PluginManager.h, offload/liboffload exports

[offload][omp] Load plugins through liboffload
DeltaFile
+16-11offload/libompaccsupport/PluginManager.cpp
+5-0offload/liboffload/src/OffloadImpl.cpp
+2-1offload/include/PluginManager.h
+1-1offload/liboffload/exports
+24-134 files

LLVM/project ed59665offload/unittests/OffloadAPI/platform olIteratePlatforms.cpp

add test
DeltaFile
+45-0offload/unittests/OffloadAPI/platform/olIteratePlatforms.cpp
+45-01 files

LLVM/project 80ab4cdoffload/liboffload/API Platform.td, offload/liboffload/src OffloadImpl.cpp

[OFFLOAD]add olIteratePlatforms
DeltaFile
+23-0offload/liboffload/API/Platform.td
+11-0offload/liboffload/src/OffloadImpl.cpp
+34-02 files

LLVM/project 5310f78offload/liboffload/src OffloadImpl.cpp

don't initialize devices when validating the image
DeltaFile
+1-5offload/liboffload/src/OffloadImpl.cpp
+1-51 files

LLVM/project 26d3c25clang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen CIRGenFunction.cpp

[CIR] Implement 'vtable initialization' lowering (#220946)

This showed up in a test suite, and is basically just ensuring that our
vtable pointers are properly cleaned up during destruction. The entirety
of the static functions (and the implementation) are near word-for-word
copies of what classic codegen does.

However, there ARE a few parts that are potentially untested(including
strict-vtable-pointers which aren't implemented yet), but the
implementation is put in place, as it is a mechanical copy/paste
implementation.

Note: Claude came up with additional test cases.
DeltaFile
+179-0clang/test/CIR/CodeGen/destructor-vtable-reinit.cpp
+46-0clang/test/CIR/CodeGen/destructor-vtable-reinit-strict.cpp
+13-1clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+0-1clang/include/clang/CIR/MissingFeatures.h
+238-24 files