LLVM/project ca70db3clang/lib/AST StmtOpenMP.cpp, clang/lib/Sema SemaOpenMP.cpp

[Clang][OpenMP] Canonicalize Intra-tiles in Loop Tiling (#191114)

This PR canonicalizes the intra-tile loop in OpenMP loop tiling.

Take a simple example:

```cpp
#pragma omp tile sizes(4)
for (int i = 0; i < 6; ++i)
  body(i);
```

`clang` turns the above into **2 nested loops**:

- Outer (aka *floor*) loop iterating in steps of 4.
- Inner (aka *intra-tile*) loop iterating over the tiles — `(0, 1, 2,
3)` and `(4, 5)` — since 6 is not a multiple of 4, this results in the
last **partial tile**.


    [42 lines not shown]
DeltaFile
+1,738-2,433clang/test/OpenMP/interchange_codegen.cpp
+252-450clang/test/OpenMP/tile_codegen.cpp
+200-24clang/lib/Sema/SemaOpenMP.cpp
+174-0clang/test/OpenMP/tile_collapse_reinterpret_codegen.cpp
+168-0clang/test/OpenMP/tile_rect_codegen_ir.cpp
+64-12clang/lib/AST/StmtOpenMP.cpp
+2,596-2,91915 files not shown
+3,129-2,92221 files

LLVM/project 47bafb7llvm/lib/Target/Sparc SparcAsmPrinter.cpp, llvm/test/CodeGen/SPARC inlineasm-global-memory.ll

[SPARC] Preserve inline asm relocation modifiers (#219971)

Make sure that inline assembly that references a global symbol gets the
correct relocation.

sethi %hi(fsr_storage), %i0
st %fsr, [%i0+fsr_storage]
ld [%i0+fsr_storage], %i0
-->
sethi %hi(fsr_storage), %i0
st %fsr, [%i0+%lo(fsr_storage)]
ld [%i0+%lo(fsr_storage)], %i0

(cherry picked from commit cf584bda4c3434086f7fdfebd1c0ce8ecb9423bb)
DeltaFile
+14-0llvm/test/CodeGen/SPARC/inlineasm-global-memory.ll
+12-0llvm/lib/Target/Sparc/SparcAsmPrinter.cpp
+26-02 files

LLVM/project 91d740bclang/lib/Sema SemaConcept.cpp, clang/test/SemaCXX cxx2c-fold-exprs.cpp

release/23.x: Backport '[Clang] Fix C++26 fold expression normalization of PackIndexingExpr'

It turns out that PackIndexingExpr doesn't create any PackExpansionTypes
for unexpanded packs and thus we don't have to remove the packs during the normalization.
DeltaFile
+30-0clang/test/SemaCXX/cxx2c-fold-exprs.cpp
+6-0clang/lib/Sema/SemaConcept.cpp
+36-02 files

LLVM/project 8e18109llvm/lib/Target/LoongArch LoongArchLASXInstrInfo.td, llvm/test/CodeGen/LoongArch/lasx vec-zext-invec.ll vec-sext-invec-mask.ll

[LoongArch] Add omitted LASX patterns for vector extend (#219351)

Adds omitted 128-bit to 256-bit patterns for `sign_extend_vector_inreg`,
including `v16i8 -> v4i64` and `v8i16 -> v4i64`, which will generate by
the combination of `icmp + or/and/xor + zext/sext`, all related tests
are added.

Fix: https://github.com/llvm/llvm-project/issues/219224
(cherry picked from commit 715901096defbb408d9fb1a6f7e1959938d950c8)
DeltaFile
+251-0llvm/test/CodeGen/LoongArch/lasx/vec-sext-invec-mask.ll
+57-0llvm/test/CodeGen/LoongArch/lasx/vec-zext-invec.ll
+20-8llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
+328-83 files

LLVM/project 6b81601llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 intrinsic-vector-match-sve2.ll

[AArch64] Widen v3i8/v4i8 VECTOR_MATCH needles (#218972)

The default legalization behaviour for v3i8 and v4i8 types is to promote
them to v4i16. This currently results in VECTOR_MATCH operations with
needles of v3i8/v4i8 needles being expanded for AArch64.

It's generally preferable to widen the needle instead (especially if the
needle is a constant vector, which becomes an immediate splat). For SVE,
this can fold multiple vector compares into a dup + match.
DeltaFile
+111-38llvm/test/CodeGen/AArch64/intrinsic-vector-match-sve2.ll
+32-2llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+143-402 files

LLVM/project 2c2cffallvm/lib/Transforms/Scalar LoopInterchange.cpp, llvm/test/Transforms/LoopInterchange reduction-minmax-multi-use.ll

[LoopInterchange] Bail out on reductions with uses outside their chain. (#220263)

getMinMaxRecurrence() can return a descriptor for a min/max phi that has
users outside of the reduction chain, e.g. the comparison of an
argmin/argmax idiom. Such descriptors have no loop exit instruction, and
the extra uses make the order in which the elements are visited
observable.

Bail out for such reductions, matching what
canParallelizeReductionWhenUnrolling() already does.

This fixes a crash on the added test cases.

PR: https://github.com/llvm/llvm-project/pull/220263
DeltaFile
+129-0llvm/test/Transforms/LoopInterchange/reduction-minmax-multi-use.ll
+5-0llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+134-02 files

LLVM/project e4e18dbllvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination induction-relational-predicate-latch.ll

[ConstraintElim] Derive IV bound from an relation predicate in latch. (#220107)

A loop whose latch has a relational predicate of the IV post-increment
as exit condition steps *past* the bound rather than landing on it, so
the
existing EQ/NE step reasoning does not apply.

But the condition (IV+Step Pred N) holds for the induction phi each
iteration after the first (when the header is entered via the guarded
 latch).

In the first iteration, the induction phi's value is its start value.
Together with a precondition (Start Pred N), (IV Pred N) hold in each
iteration.

Add this as fact enables removing a few redundant conditions in
practice:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1148.


    [4 lines not shown]
DeltaFile
+715-0llvm/test/Transforms/ConstraintElimination/induction-relational-predicate-latch.ll
+24-11llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+739-112 files

LLVM/project c84294fclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Generate getSuccessorRegions for fixed-region ops

Six of the ten CIR ops implementing RegionBranchOpInterface reported a fixed
list of entry regions and the parent operation on every region exit, which
makes the whole method derivable from the region accessor names. Add a
CIR_FixedRegionBranchOp class that appends the generated definition to the one
inherited from CIR_RegionBranchOpBase, retarget the six ops onto it and delete
their hand-written definitions.

IfOp, GlobalOp, TryOp and AwaitOp stay on the base class, since their entry
edges are not a fixed list: IfOp falls back to the parent when the else region
is empty, GlobalOp skips its optional ctor and dtor regions, TryOp iterates
variadic handler regions, and AwaitOp routes ready to resume and suspend.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
six definitions removed from CIRDialect.cpp.
DeltaFile
+0-67clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+31-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+31-732 files

LLVM/project 04376fcclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorInputs across region-branch ops

The ten CIR ops implementing RegionBranchOpInterface each hand-wrote
getSuccessorInputs, and all ten bodies were equivalent: regions take no
inputs, and returning to the parent yields the parent's results. Three did
not look equivalent but are: CleanupScopeOp and CoroBodyOp returned an empty
ValueRange unconditionally and declare no results, and AwaitOp returned
region block arguments but carries NoRegionArguments, so those ranges are
always empty.

Add a CIR_RegionBranchOpBase ODS class that declares the method and generates
the single shared body through extraClassDefinition, mirroring the existing
CIR_LoopOpBase, and retarget all ten ops onto it.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
ten definitions removed from CIRDialect.cpp.
DeltaFile
+0-57clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+28-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+28-772 files

LLVM/project b1281d1clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/unittests/CIR ControlFlowTest.cpp

[CIR] Add RegionBranchOpInterface unit tests and fix cir.await successors

Five of the ten ops implementing RegionBranchOpInterface have no unit test
coverage: cir.case, cir.cleanup.scope, cir.global, cir.await and
cir.coro.body. Add tests for all five.

Covering cir.await exposes a disagreement with its own terminator.
cir.condition terminates the ready region and reports {resume, suspend} as
its successors when the parent is an await, but AwaitOp::getSuccessorRegions
listed all three regions as entry successors and reported the parent op as
the successor of every region exit. Fix it to match cir.condition: ready is
the only entry successor, exiting ready branches to resume or suspend, and
exiting suspend or resume returns to the parent operation.

cir.await declares no results and carries NoRegionArguments, so successor
operand and input counts stay at zero along every edge and the MLIR verifier
is unaffected.
DeltaFile
+155-0clang/unittests/CIR/ControlFlowTest.cpp
+20-7clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+175-72 files

LLVM/project 31ef695llvm/lib/Target/AMDGPU AMDGPULowerIntrinsics.cpp, llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp

[AMDGPU] Validate barrier ID in S_BARRIER_SIGNAL_ISFIRST

Value user_cluster_barrier_id is not supported.
DeltaFile
+3-36llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll
+23-0llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+9-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.signal.isfirst.invalid_barrier.ll
+5-0llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
+5-0llvm/test/MC/AMDGPU/gfx13_err.s
+3-0llvm/test/MC/AMDGPU/gfx12_err.s
+48-361 files not shown
+49-367 files

LLVM/project 5312769llvm/test/MC/AMDGPU gfx12_err.s

[AMDGPU] Regenerate gfx12_err.s. NFC (#220437)

Wrong tool was recorded in the test header.
DeltaFile
+221-222llvm/test/MC/AMDGPU/gfx12_err.s
+221-2221 files

LLVM/project 2f2aa94lldb/source/Plugins/LanguageRuntime/CPlusPlus ItaniumABIRuntime.cpp, lldb/source/Plugins/SymbolFile/DWARF SymbolFileDWARF.cpp

[lldb] Fallback to `__clang_vtable` for robust dynamic type resolution (#210584)

`ItaniumABIRuntime::GetTypeInfo(...)`'s type resolution relies on the
demangler to locate the type corresponding to a vtable address. As
reported in #182762 this can break when the demangler and debug info
don't agree on the spelling of the type's name.

This PR implements an lookup based on a support member emitted by clang
added in #130255 as `_vtable$`, later renamed to `__clang_vtable` in
#183617. If the demangling based approach fails we fall back to the new
route.

The initial implementation aims to only support the modern spelling with
DWARF.
DeltaFile
+90-2lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABIRuntime.cpp
+38-0lldb/test/API/lang/cpp/dynamic-value-complex-typename/TestDynamicValueComplexTypename.py
+38-0lldb/test/API/lang/cpp/dynamic-value-virtual-inheritance/TestDynamicValueVirtualInheritance.py
+36-0lldb/test/API/lang/cpp/dynamic-value-virtual-inheritance/main.cpp
+34-0lldb/test/API/lang/cpp/dynamic-value-complex-typename/main.cpp
+16-0lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+252-210 files not shown
+301-216 files

LLVM/project 2e5620ellvm/lib/CodeGen/SelectionDAG LegalizeFloatTypes.cpp, llvm/test/CodeGen/SystemZ soft-float-05.ll

[SelectionDAG] powi and ldexp libcalls deal with signed int arguments (#213673)

While investigating a sign extension problem on an off-tree target that
needs extension of 32-bit integer argument to 64-bit register when
passed as an argument, I found that `__powisf2` was being passed
zero-extended despite the argument being a signed `int`. I narrowed this
down to the fact that `shouldSignExtendTypeInLibCall` was being passed
`false` for `IsSigned` for the `int` argument in these libcalls.

Other libcalls (not an exhaustive review) such as the `XINT_TO_FP`
family do set the `IsSigned` value here.

I utilized the s390x target to write a test for this.
DeltaFile
+48-0llvm/test/CodeGen/SystemZ/soft-float-05.ll
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+49-02 files

LLVM/project 1f4fbe8llvm/lib/Target/RISCV RISCVVectorPeephole.cpp RISCVInstrInfoZvzip.td, llvm/test/CodeGen/RISCV/rvv vmerge-peephole.mir vpaire.ll

[RISCV] Teach the VL Optimizer about Zvzip instructions (#214405)

Set ElementsDependOn = EltDepsNone on the five Zvzip instructions
(VZIP_VV, VUNZIPE_V, VUNZIPO_V, VPAIRE_VV, VPAIRO_VV) so the pass no
longer conservatively treats their result elements as depending on VL
and Mask (beyond masking of inactive lanes).

Wire the opcodes into the VL Optimizer's operand model:

 - getOperandLog2EEW: all five instructions return MILog2SEW (source
   and destination EEW both equal SEW).

 - getOperandInfo: for VZIP_VV, widen the destination and passthru
   EMUL by 2x since it interleaves two LMUL inputs into one 2xLMUL
   result. For VUNZIPE_V / VUNZIPO_V, widen the EMUL of the vs2
   source operand by 2x instead, as the split consumes a 2xLMUL
   vector and produces an LMUL even/odd half. VPAIRE_VV / VPAIRO_VV
   leave EMUL unchanged on every operand.

Assisted-by: TRAE CLI (Seed-2.1-Turbo)
DeltaFile
+186-1llvm/test/CodeGen/RISCV/rvv/vl-opt-op-info.mir
+54-4llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+32-24llvm/test/CodeGen/RISCV/rvv/vpaire.ll
+19-2llvm/test/CodeGen/RISCV/rvv/vmerge-peephole.mir
+5-3llvm/lib/Target/RISCV/RISCVInstrInfoZvzip.td
+4-2llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
+300-366 files

LLVM/project 3cf119allvm/lib/ExecutionEngine/Orc SelfExecutorProcessControl.cpp, llvm/lib/ExecutionEngine/Orc/TargetProcess OrcRTBootstrap.h OrcRTBootstrap.cpp

[ORC] Register SPS run-as function wrappers with SelfEPC (#220224)

#213265 replaced the direct `ExecutorProcessControl::runAsVoidFunction`
and `runAsIntFunction` calls in `COFFPlatform` and
`COFFVCRuntimeSupport` with SPS call proxies. The target-process
bootstrap registers the corresponding executor-side wrappers for
`SimpleRemoteEPC`, but SelfEPC does not register them. In-process
clients using these paths therefore fail to resolve:

```text
orc_rt_ci_sps_call_int32_void
orc_rt_ci_sps_call_int32_int32
```

This patch factors registration of the two existing run-as function
wrappers out of the complete target-process bootstrap set and adds that
narrow set to SelfEPC.

SelfEPC already provides in-process memory access directly, so it does

    [14 lines not shown]
DeltaFile
+29-0llvm/unittests/ExecutionEngine/Orc/SPSProxySpecTest.cpp
+8-4llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
+4-0llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.h
+3-0llvm/lib/ExecutionEngine/Orc/SelfExecutorProcessControl.cpp
+44-44 files

LLVM/project 9c79a77llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv vabd.ll

[RISCV] Fix result type checks in the VWABDA DAG combine (#220497)

Fix the result element type check in `performVWABDACombine`. The result
of the widening add operation has already been widened, so the expected
element types are `i16` and `i32`, rather than `i8` and `i16`. The
previous check prevented the i16-i32 form from being combined.
DeltaFile
+34-0llvm/test/CodeGen/RISCV/rvv/vabd.ll
+2-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+36-22 files

LLVM/project 3accf66clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Generate getSuccessorRegions for fixed-region ops

Six of the ten CIR ops implementing RegionBranchOpInterface reported a fixed
list of entry regions and the parent operation on every region exit, which
makes the whole method derivable from the region accessor names. Extend
CIR_RegionBranchOpBase with an entryRegions parameter that generates it and
delete the six hand-written definitions.

IfOp, GlobalOp, TryOp and AwaitOp keep theirs, since their entry edges are not
a fixed list: IfOp falls back to the parent when the else region is empty,
GlobalOp skips its optional ctor and dtor regions, TryOp iterates variadic
handler regions, and AwaitOp routes ready to resume and suspend.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
six definitions removed from CIRDialect.cpp.
DeltaFile
+0-67clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+33-14clang/include/clang/CIR/Dialect/IR/CIROps.td
+33-812 files

LLVM/project 8efad88clang/include/clang/Basic AArch64CodeGenUtils.h, clang/lib/CIR/CodeGen CIRGenBuiltinAArch64.cpp

[clang][CIR][AArch64] Add lowering for SISD variants of rounding intrinsics (#219241)

This PR adds lowering for the remaining SISD "Vector saturating rounding
shift right and narrow " intrinsic:
* https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#vector-saturating-rounding-shift-right-and-narrow

The following builtins are added:
 * __builtin_neon_vqrshrns_n_s32:
 * __builtin_neon_vqrshrns_n_u32:
 * __builtin_neon_vqrshrnh_n_s16:
 * __builtin_neon_vqrshrnh_n_u16:
 * __builtin_neon_vqrshruns_n_s32:
 * __builtin_neon_vqrshrunh_n_s16:

The corresponding tests are moved from:
  * clang/test/CodeGen/AArch64/

to:
  * clang/test/CodeGen/AArch64/neon/

    [2 lines not shown]
DeltaFile
+73-1clang/test/CodeGen/AArch64/neon/intrinsics.c
+0-70clang/test/CodeGen/AArch64/neon-intrinsics.c
+6-6clang/include/clang/Basic/AArch64CodeGenUtils.h
+6-0clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+85-774 files

LLVM/project f343a76llvm/lib/Transforms/IPO MergeFunctions.cpp, llvm/lib/Transforms/Utils FunctionComparator.cpp

[MergeFunctions] Intersect poison-generating flags (#220015)

Instead of comparing the flags in FunctionComparator, intersect them in
MergeFunctions. This both a) fixes miscompiles where we failed to check
the poison flags for GEP and FMF and b) allows more function merging, in
cases where the functions only differ in flags.

This can be extended to combine instruction-level metadata as well in
the future.

Fixes https://github.com/llvm/llvm-project/issues/219664.
DeltaFile
+86-0llvm/test/Transforms/MergeFunc/flags.ll
+23-22llvm/lib/Transforms/IPO/MergeFunctions.cpp
+0-8llvm/lib/Transforms/Utils/FunctionComparator.cpp
+109-303 files

LLVM/project 19559bdutils/bazel/llvm-project-overlay/libc platforms.bzl BUILD.bazel

[Bazel] Add missing includes for riscv64 (#219483)
DeltaFile
+3-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+2-0utils/bazel/llvm-project-overlay/libc/platforms.bzl
+5-12 files

LLVM/project 2033899clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorInputs across region-branch ops

The ten CIR ops implementing RegionBranchOpInterface each hand-wrote
getSuccessorInputs, and all ten bodies were equivalent: regions take no
inputs, and returning to the parent yields the parent's results. Three did
not look equivalent but are: CleanupScopeOp and CoroBodyOp returned an empty
ValueRange unconditionally and declare no results, and AwaitOp returned
region block arguments but carries NoRegionArguments, so those ranges are
always empty.

Add a CIR_RegionBranchOpBase ODS class that declares the method and generates
the single shared body through extraClassDefinition, mirroring the existing
CIR_LoopOpBase, and retarget all ten ops onto it.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
ten definitions removed from CIRDialect.cpp.
DeltaFile
+0-57clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+31-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+31-772 files

LLVM/project 01e2d19llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 sve-vector-repeat.ll

Support nxv1 types
DeltaFile
+94-0llvm/test/CodeGen/AArch64/sve-vector-repeat.ll
+17-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+111-02 files

LLVM/project 7c3201ellvm/include/llvm/Transforms/Vectorize/SandboxVectorizer VecUtils.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BundleVec.cpp

[SandboxVec][NFC] Hoist getInsertPointAfterInstrs into VecUtils (#215863)

Move BottomUpVec.cpp's file-local getInsertPointAfterInstrs() into
VecUtils. NFC.

Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
DeltaFile
+87-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/VecUtilsTest.cpp
+6-18llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
+14-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
+107-183 files

LLVM/project 2495d82orc-rt/include/orc-rt-c/support Compiler.h, orc-rt/include/orc-rt-internal/support/sys CacheControl.h

[orc-rt] Add ORC_RT_HAS_BUILTIN, stop defining __has_builtin (#220503)

orc-rt/support/Compiler.h supplied a fallback definition of
__has_builtin for compilers that lack it. __has_builtin is a reserved
identifier, and defining one from a public header can collide with the
compiler's own definition or with another library the client includes.

Replace it with ORC_RT_HAS_BUILTIN(X) in orc-rt-c/support/Compiler.h,
which wraps __has_builtin where it exists and expands to 0 otherwise,
and convert the five uses.
DeltaFile
+13-0orc-rt/include/orc-rt-c/support/Compiler.h
+2-6orc-rt/include/orc-rt/support/Compiler.h
+4-2orc-rt/include/orc-rt/support/bit.h
+1-1orc-rt/include/orc-rt-internal/support/sys/CacheControl.h
+20-94 files

LLVM/project 058c728clang/lib/Sema SemaCUDA.cpp, clang/test/SemaHIP hip-incremental-toplevel-launch.hip

[clang][Sema] Allow null caller for HIP kernel launch in incremental mode (#218659)

This PR allows a HIP kernel to be launched without a caller in
incremental mode. This is necessary because in incremental
mode(clang-repl), there isn't a `main` or any function that calls the
kernel.

Also adds a Sema test that compiles a top-level HIP kernel launch in
incremental device mode and verifies it is accepted.

Assisted by Claude Opus 4.8
DeltaFile
+29-0clang/test/SemaHIP/hip-incremental-toplevel-launch.hip
+5-3clang/lib/Sema/SemaCUDA.cpp
+34-32 files

LLVM/project fee2e96clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/unittests/CIR ControlFlowTest.cpp

[CIR] Add RegionBranchOpInterface unit tests and fix cir.await successors

Five of the ten ops implementing RegionBranchOpInterface have no unit test
coverage: cir.case, cir.cleanup.scope, cir.global, cir.await and
cir.coro.body. Add tests for all five.

Covering cir.await exposes a disagreement with its own terminator.
cir.condition terminates the ready region and reports {resume, suspend} as
its successors when the parent is an await, but AwaitOp::getSuccessorRegions
listed all three regions as entry successors and reported the parent op as
the successor of every region exit. Fix it to match cir.condition: ready is
the only entry successor, exiting ready branches to resume or suspend, and
exiting suspend or resume returns to the parent operation.

cir.await declares no results and carries NoRegionArguments, so successor
operand and input counts stay at zero along every edge and the MLIR verifier
is unaffected.
DeltaFile
+155-0clang/unittests/CIR/ControlFlowTest.cpp
+20-7clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+175-72 files

LLVM/project dcf6f15mlir/lib/Dialect/SCF/Transforms StructuralTypeConversions.cpp, mlir/test/Transforms test-legalize-type-conversion.mlir

[mlir][SCF] Handle dropped operands in structural type conversion (#220473)

SCF structural type conversion assumes that `scf.for` bounds and
`scf.if` conditions are converted to exactly one value. A 1:N conversion
can drop or split these operands, causing `getSingleElement` to trigger
an assertion.

Reject conversions with non-single-valued bounds or conditions and add
regression coverage.

Fixes: https://github.com/llvm/llvm-project/issues/220459
DeltaFile
+27-0mlir/test/Transforms/test-legalize-type-conversion.mlir
+10-0mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
+9-0mlir/test/lib/Dialect/Test/TestPatterns.cpp
+46-03 files

LLVM/project 529c4daclang/include/clang/Basic DiagnosticFrontendKinds.td CodeGenOptions.def, clang/lib/CodeGen CGException.cpp CodeGenModule.cpp

clang: Distinguish unspecified from disabled exception model

Add ExceptionHandlingKind::Default so clang can tell an unspecified
exception model from an explicit -exception-model=none.
DeltaFile
+18-17clang/test/CodeGen/exception-model-flag.c
+10-1clang/include/clang/Basic/CodeGenOptions.h
+5-4clang/lib/CodeGen/CodeGenModule.cpp
+4-2clang/lib/CodeGen/CGException.cpp
+1-1clang/include/clang/Basic/DiagnosticFrontendKinds.td
+1-1clang/include/clang/Basic/CodeGenOptions.def
+39-266 files not shown
+45-3212 files

LLVM/project b79523cclang/include/clang/Basic CodeGenOptions.h, clang/lib/CodeGen CodeGenModule.cpp

clang: Emit "exception-model" module flag

Record the exception-handling model as an "exception-model" IR module
flag when it differs from the target triple's default, mirroring how
other target ABI properties are recorded. Adds a
CodeGenOptions::toExceptionHandling helper to translate clang's
ExceptionHandlingKind into the LLVM ExceptionHandling enum.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+38-0clang/test/CodeGen/exception-model-flag.c
+19-0clang/include/clang/Basic/CodeGenOptions.h
+12-0clang/lib/CodeGen/CodeGenModule.cpp
+69-03 files