LLVM/project 39f1fb9clang/lib/Sema SemaStmtAsm.cpp, clang/test/Sema asm.c

[InlineAsm] Diagnose oversized non-scalar tied asm outputs (#206230)

The 'r' asm constraint binds an operand to a general-purpose register.
For tied inline asm operands, Clang may promote a smaller integer input
to match a larger non-scalar register output. Only allow that path when
the output size can be represented by an integer type that fits in a
general-purpose register.

Otherwise, diagnose with err_store_value_to_reg before CodeGen attempts
to lower the asm and crashes.

This keeps GPR-sized aggregate/class outputs accepted while rejecting
larger array, struct, union, complex, vector, and class outputs. Add
Sema coverage for the affected C and C++ cases.

Fixes #204775
DeltaFile
+42-0clang/test/SemaCXX/inline-asm-aggregate-output.cpp
+21-3clang/test/Sema/asm.c
+7-4clang/lib/Sema/SemaStmtAsm.cpp
+70-73 files

LLVM/project 56b5db1orc-rt/include/orc-rt Error.h

[orc-rt] Apply noexcept to more Error.h APIs. (#207109)

These APIs are all unconditionally nothrow: their bodies either call
already-noexcept APIs, or move std::string / std::exception_ptr /
std::unique_ptr members whose move constructors are already noexcept.
DeltaFile
+11-11orc-rt/include/orc-rt/Error.h
+11-111 files

LLVM/project bcf504allvm/test/Transforms/SLPVectorizer non-power-of-2-buildvector.ll, llvm/test/Transforms/SLPVectorizer/X86 odd_store.ll

Fix clang-format issue.
DeltaFile
+42-23llvm/test/Transforms/SLPVectorizer/X86/odd_store.ll
+3-23llvm/test/Transforms/SLPVectorizer/non-power-of-2-buildvector.ll
+45-462 files

LLVM/project edfd65bllvm/lib/Transforms/Vectorize SLPVectorizer.cpp

Update for comments and fix lit test
DeltaFile
+4-5llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+4-51 files

LLVM/project 4e8a927llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

[SLP] Allow non-power-of-2 VF in tryToVectorizeList
DeltaFile
+6-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+6-11 files

LLVM/project a8166e1llvm/test/Transforms/SLPVectorizer non-power-of-2-buildvector.ll

[SLP][NFC] Add non-power-of-2 buildvector test (#206332)

For this PR: https://github.com/llvm/llvm-project/pull/206259
DeltaFile
+112-0llvm/test/Transforms/SLPVectorizer/non-power-of-2-buildvector.ll
+112-01 files

LLVM/project c9721e6clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp, clang/test/CIR/CodeGen paren-list-agg-init.cpp struct.cpp

[CIR] Add alignment attributes to cir.copy (#206341)
DeltaFile
+18-18clang/test/CIR/CodeGen/paren-list-agg-init.cpp
+12-12clang/test/CIR/CodeGen/struct.cpp
+21-1clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+10-10clang/test/CIR/CodeGen/abstract-cond.c
+9-9clang/test/CIR/CodeGenCXX/new-array-init.cpp
+8-8clang/test/CIR/CodeGen/three-way-cmp.cpp
+78-5838 files not shown
+180-14444 files

LLVM/project da36460llvm/lib/Target/MSP430 MSP430AsmPrinter.cpp

rebase

Created using spr 1.3.7
DeltaFile
+1-1llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp
+1-11 files

LLVM/project 63352f4llvm/lib/Target/MSP430 MSP430AsmPrinter.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+1-1llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp
+1-11 files

LLVM/project 0d15a4ellvm/lib/Target/MSP430 MSP430AsmPrinter.cpp

fix

Created using spr 1.3.7
DeltaFile
+1-1llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp
+1-11 files

LLVM/project ee6d926orc-rt/include/orc-rt Error.h

[orc-rt] Apply noexcept to newly fixed Expected::isFailureOfType. (#207106)
DeltaFile
+1-1orc-rt/include/orc-rt/Error.h
+1-11 files

LLVM/project fb92fdellvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv vselect-fp.ll

[RISCV] Canonicalize the true operand of vselect to fold more vmerge.vvm instructions (#206449)

Convert (vselect CC, true, false) to (vselect InvertCC, false, true)
when false has one use, true has multiple use and CC is SETEQ or ISD::SETNE.

When compile llvm-test-suite with --march=rv64gcv -O3 -ffast-math,
Without this patch, foldVMergeToMask removes `441` PseudoVMERGE_VVM
instructions.
With this patch, foldVMergeToMask removes `794` PseudoVMERGE_VVM
instructions.
DeltaFile
+44-5llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+30-0llvm/test/CodeGen/RISCV/rvv/vselect-fp.ll
+74-52 files

LLVM/project 21fbbe7clang/lib/Sema SemaOpenMP.cpp

Rename function
DeltaFile
+13-8clang/lib/Sema/SemaOpenMP.cpp
+13-81 files

LLVM/project d4fe91dflang/include/flang/Optimizer/Transforms Passes.td, flang/lib/Optimizer/Transforms CMakeLists.txt

[flang][cuda] Add CUFAllocDelay pass to defer device descriptor allocation (#206882)

Add a new MLIR pass that delays cuf.alloc operations for allocatable
descriptor (box) types from function entry to just before their first
use. This defers cudaMallocManaged calls so that programs can call
cudaSetDevice or initialize communication libraries before any CUDA
context is created.
DeltaFile
+367-0flang/test/Transforms/CUF/cuf-alloc-delay.fir
+165-0flang/lib/Optimizer/Transforms/CUDA/CUFAllocDelay.cpp
+11-0flang/include/flang/Optimizer/Transforms/Passes.td
+1-0flang/lib/Optimizer/Transforms/CMakeLists.txt
+544-04 files

LLVM/project 815533bclang/include/clang/Sema Sema.h, clang/lib/Parse ParseTemplate.cpp ParseExprCXX.cpp

[clang] fix typo correction crash with template destructor names (#207101)

Disables typo correction for template destructor names, as typo
correction is not aware of destructors and would provide suugestions
which would form an invalid name.

Since this fixes a regression that was never released, there are no
release notes.

Fixes #206992
DeltaFile
+7-11clang/lib/Sema/SemaTemplate.cpp
+7-8clang/lib/Parse/ParseTemplate.cpp
+4-4clang/lib/Parse/ParseExprCXX.cpp
+6-0clang/test/SemaCXX/typo-correction.cpp
+1-1clang/include/clang/Sema/Sema.h
+25-245 files

LLVM/project 24e7deeclang/docs ReleaseNotes.md, clang/lib/Sema SemaTemplateInstantiateDecl.cpp

[clang] Fix crash in VisitVarTemplatePartialSpecializationDecl on failed instantiation (#200161)

Fixes #198890

When a class template is explicitly instantiated and a member variable
template's type involves a substitution failure (e.g. `typename T::type`
with `T=int`), `VisitVarDecl` returned `nullptr`, causing
`VisitVarTemplateDecl` to bail out before registering the
`VarTemplateDecl` in the owner's lookup table. A subsequent call to
`VisitVarTemplatePartialSpecializationDecl` then hit an assert
(`!Found.empty()`) on the empty lookup result.

Fix: When `SubstType` fails and `InstantiatingVarTemplate=true`, recover
by using `int` as the type (via `getTrivialTypeSourceInfo(IntTy)`) and
mark the resulting `VarDecl` invalid. This ensures
`VisitVarTemplateDecl` always receives a valid `VarDecl` and finishes
registering the `VarTemplateDecl`, preserving the invariant the asserts
rely on.

A regression test is added in `clang/test/SemaTemplate/GH198890.cpp`.
DeltaFile
+26-0clang/test/SemaTemplate/GH198890.cpp
+14-5clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+5-0clang/docs/ReleaseNotes.md
+45-53 files

LLVM/project 70de698orc-rt/include/orc-rt Error.h, orc-rt/unittests ErrorTest.cpp

[orc-rt] Fix unused Expected::isFailureOfType, add testcase. (#207105)

Expected::isFailureOfType method template was calling a non-existant
Error::isFailureOfType method, but didn't trigger any compile errors as
isFailureOfType was unused. This commit fixes isFailureOfType and adds a
testcase to exercise it.
DeltaFile
+22-0orc-rt/unittests/ErrorTest.cpp
+1-1orc-rt/include/orc-rt/Error.h
+23-12 files

LLVM/project bcf2f5cclang/include/clang/AST OpenMPClause.h, clang/include/clang/Sema SemaOpenMP.h

Fix review comments
DeltaFile
+20-18clang/include/clang/AST/OpenMPClause.h
+20-7clang/lib/Sema/SemaOpenMP.cpp
+10-10clang/test/OpenMP/teams_num_teams_messages.cpp
+8-8clang/test/OpenMP/target_teams_distribute_num_teams_messages.cpp
+5-4clang/include/clang/Sema/SemaOpenMP.h
+4-4clang/test/OpenMP/target_teams_distribute_parallel_for_num_teams_messages.cpp
+67-513 files not shown
+75-569 files

LLVM/project 37e83e7orc-rt/include/orc-rt Error.h

[orc-rt] Add some missing noexcept specifiers to Error.h. (#206984)
DeltaFile
+25-21orc-rt/include/orc-rt/Error.h
+25-211 files

LLVM/project 92313efmlir/include/mlir-c Rewrite.h, mlir/lib/CAPI/Transforms Rewrite.cpp

Revert "[mlir-c] Add ConversionTarget dynamic legality C API" (#207104)

Reverts llvm/llvm-project#206161 due to SAN failures.
DeltaFile
+0-180mlir/test/CAPI/rewrite.c
+0-60mlir/lib/CAPI/Transforms/Rewrite.cpp
+0-44mlir/include/mlir-c/Rewrite.h
+0-2843 files

LLVM/project 53069acclang/lib/CIR/CodeGen CIRGenExprConstant.cpp, clang/lib/CIR/Dialect/IR CIRAttrs.cpp

[CIR] Implement Flexible Array Members for const-record lowering (#206564)

The previous patch I did rewrote the ConstRecordBuilder in a way that
resulted in flexible array members being an NYI. This was because it
requires quite a bit of additional work to accomplish this.

This patch does this implementation. It does so by: 1- Changing the CIR
dialect to just support them. If a struct type ends in a zero size
array, it allows constant initialization with a non-zero array size.
This patch adds this, as well as tests to do so.

2- Change our LowerToLLVM to detect this pattern, and substitute in the
struct-literal type. There is some additional work to allow us to do a
padded literal, which results in slightly more matches to classic
codegen. But otherwise, it is a pretty straight forward struct
replacement with a larger array type.
DeltaFile
+91-3clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+60-0clang/test/CIR/CodeGen/flexible-array-init.c
+33-0clang/test/CIR/IR/invalid-const-record.cir
+28-3clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+21-0clang/test/CIR/IR/const-record-flexible-array.cir
+7-6clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+240-122 files not shown
+255-128 files

LLVM/project e787692clang/include/clang/Sema Sema.h, clang/lib/Parse ParseTemplate.cpp ParseExprCXX.cpp

[clang] fix typo correction crash with template destructor names

Disables typo correction for template destructor names,
as typo correction is not aware of destructors and would
provide suugestions which would form an invalid name.

Since this fixes a regression that was never released, there are no release
notes.

Fixes #206992
DeltaFile
+7-11clang/lib/Sema/SemaTemplate.cpp
+7-8clang/lib/Parse/ParseTemplate.cpp
+4-4clang/lib/Parse/ParseExprCXX.cpp
+6-0clang/test/SemaCXX/typo-correction.cpp
+1-1clang/include/clang/Sema/Sema.h
+25-245 files

LLVM/project 6b3e723lldb/include/lldb/Utility Policy.h, lldb/source/Target Process.cpp StopInfo.cpp

[lldb] Harden PolicyStack against cross-thread Guard misuse (#195774)

Two related correctness/clarity improvements to the `Policy`
infrastructure introduced by 504a112:

`PolicyStack::Guard` now stores the std::thread::id of the thread that
created it. Destruction and move operations call
`llvm::report_fatal_error` when they happen on a different thread, since
the `PolicyStack` is `thread_local`: popping from the wrong thread would
silently corrupt that thread's stack.

`Push`/`Pop` on `PolicyStack` are now private. Callers go through named
factories (`PushPrivateState`, `PushPublicStateRunningExpression`) that
return RAII Guards. The transition factories on Policy
(`CreatePrivateState`, `CreatePublicStateRunningExpression`) inherit
from `PolicyStack::Get().Current()` and apply their named change on top,
so pushed policies preserve existing stack state rather than resetting
unrelated fields. `CreatePublicState` remains the baseline reference
value (returns a default `Policy{}`); the stack returns to public state

    [13 lines not shown]
DeltaFile
+76-24lldb/unittests/Utility/PolicyTest.cpp
+56-29lldb/include/lldb/Utility/Policy.h
+56-0lldb/source/Utility/Policy.cpp
+6-6lldb/source/Target/Process.cpp
+2-2lldb/source/Target/StopInfo.cpp
+1-1lldb/source/Target/Thread.cpp
+197-626 files

LLVM/project bf271c1clang/include/clang/Sema Sema.h, clang/lib/Parse ParseTemplate.cpp ParseExprCXX.cpp

[clang] fix typo correction crash with template destructor names

Disables typo correction for template destructor names,
as typo correction is not aware of destructors and would
provide suugestions which would form an invalid name.

Since this fixes a regression that was never released, there are no release
notes.

Fixes #206992
DeltaFile
+7-8clang/lib/Parse/ParseTemplate.cpp
+4-4clang/lib/Parse/ParseExprCXX.cpp
+6-0clang/test/SemaCXX/typo-correction.cpp
+2-3clang/lib/Sema/SemaTemplate.cpp
+1-1clang/include/clang/Sema/Sema.h
+20-165 files

LLVM/project 26bf00bclang/test/CIR/IR invalid-linkage.cir

[CIR][NFC] Re-enable invalid linkage test (#205459)

The CIR verification test for a cir.global op with a missing linkage
attribute was broken by a change to the MLIR asm parser back in April.
At that time, I marked the test as XFAIL and added a check that would
prevent it from randomly passing. In the meantime, another MLIR parser
changed (https://github.com/llvm/llvm-project/pull/188008) fixed the
original problem.

This change reverts the test to its previous state since it now passes.
DeltaFile
+0-3clang/test/CIR/IR/invalid-linkage.cir
+0-31 files

LLVM/project 32ae6b5lldb/tools/lldb-mcp lldb-mcp.cpp CMakeLists.txt

[lldb-mcp] Link liblldb instead of the full initialization stack (#206852)

lldb-mcp linked liblldb but also pulled in lldbInitialization, which
drags in lldbCore and the entire plugin stack as a second, static copy
of LLDB alongside the dylib. It bootstrapped that copy through the
private SystemInitializerCommon.

lldb-mcp is a thin stdio proxy: it locates and forwards I/O to an lldb
subprocess and never creates a debugger. It only needs the FileSystem,
HostInfo, and Socket subsystems. Drop lldbInitialization, get the heavy
code from liblldb, and initialize just those subsystems directly (as
lldb-dap does) rather than via SystemInitializerCommon.

rdar://181054260
DeltaFile
+10-9lldb/tools/lldb-mcp/lldb-mcp.cpp
+1-1lldb/tools/lldb-mcp/CMakeLists.txt
+11-102 files

LLVM/project 87a09a0clang/include/clang/Options Options.td, clang/lib/Driver/ToolChains Clang.cpp

[clang][SYCL] Add -fsycl-device-image-split option (#206870)

Add the -fsycl-device-image-split= driver option to control how SYCL
device code is split into separate device images. Supported values:
    - kernel: one device image per SYCL kernel
    - translation_unit: one device image per translation unit
    - link_unit:        one device image per linking unit

The bare -fsycl-device-image-split flag is an alias for
-fsycl-device-image-split=translation_unit, which is also the default.

clang-sycl-linker module-split-mode option values were updated
accordingly to simplify options forwarding logic.

Co-Authored-By: Claude
DeltaFile
+31-0clang/test/Driver/sycl-offload-jit.cpp
+17-0clang/lib/Driver/ToolChains/Clang.cpp
+6-6clang/test/OffloadTools/clang-sycl-linker/split-mode.ll
+6-6clang/test/OffloadTools/clang-sycl-linker/basic.ll
+10-0clang/include/clang/Options/Options.td
+4-4clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+74-164 files not shown
+84-2010 files

LLVM/project a413409clang/lib/CodeGen CGHLSLBuiltins.cpp, clang/test/CodeGenHLSL/builtins InterlockedOr.hlsl

[HLSL][DXIL] InterlockedOr and InterlockedOr64 builtins (#180804)

This includes the first phase of implementation of the InterlockedOr
intrinsic. This covers the usage of the intrinsic/builtin on
RWByteAddressBuffers, Typed Buffers, and Structured Buffers. Not covered
are textures, groupshared memory, and the standalone
InterlockedOr(buf[index], val, ret) intrinsics.

SPIRV implementation is not covered in this commit.

Contributes to, but does not address
https://github.com/llvm/llvm-project/issues/99126
DeltaFile
+100-0clang/test/SemaHLSL/BuiltIns/InterlockedOr-errors.hlsl
+36-25clang/lib/CodeGen/CGHLSLBuiltins.cpp
+59-0clang/test/CodeGenHLSL/builtins/InterlockedOr.hlsl
+52-0llvm/test/CodeGen/DirectX/InterlockedOr.ll
+37-0llvm/test/CodeGen/SPIRV/hlsl-intrinsics/InterlockedOr_spv_i64.ll
+36-0llvm/test/CodeGen/SPIRV/hlsl-intrinsics/InterlockedOr.ll
+320-258 files not shown
+365-4314 files

LLVM/project e2eafd0clang/include/clang/ScalableStaticAnalysis/SourceTransformation TransformationReportFormat.h

fix build issue
DeltaFile
+2-0clang/include/clang/ScalableStaticAnalysis/SourceTransformation/TransformationReportFormat.h
+2-01 files

LLVM/project 974650cclang/unittests/ScalableStaticAnalysis/SourceTransformation RegistryTest.cpp

fix clang-format
DeltaFile
+2-2clang/unittests/ScalableStaticAnalysis/SourceTransformation/RegistryTest.cpp
+2-21 files