LLVM/project 1f1e888 — clang/include/clang/Basic DiagnosticParseKinds.td, clang/test/Parser c2y-if-decl-while.c

[Clang][C2y] Make the 'if' declaration extension warning on by default

Declarations in the condition of 'if' and 'switch' statements (N3356)
were previously only diagnosed in pre-C2y modes under -pedantic, since
the C compatibility warnings default to Extension. Promote the
diagnostic to an ExtWarn so users on older language modes are told
they are relying on a C2y extension; -Wno-c2y-extensions silences it.

Co-Authored-By: Claude Fable 5.1 <noreply at anthropic.com>
DeltaFile
+4-0clang/test/Parser/c2y-if-decl-while.c
+2-1clang/include/clang/Basic/DiagnosticParseKinds.td
+6-12 files

LLVM/project b0499a4 — clang/lib/Parse ParseStmt.cpp

[Clang][C2y] Simplify condition-declaration diagnostics in C

Key the diagnostics on whether a declaration is permitted as the
condition (only as the sole clause of an 'if' or 'switch'), so the two
"expected expression" emissions collapse into one and the first-clause
check is no longer nested inside the branching. No functional change.

Co-Authored-By: Claude Fable 5.1 <noreply at anthropic.com>
DeltaFile
+19-21clang/lib/Parse/ParseStmt.cpp
+19-211 files

LLVM/project 0d320da — offload/include device.h, offload/libompaccsupport device.cpp

[OpenMP][offload] Trade threads for blocks in Generic-SPMD kernels

The threads of a Generic-SPMD block run the inner parallel loops, whose
trip counts are unknown. Halve the threads down to one warp while the
distribute loop has an iteration for every block, and default to 6
blocks per CU on AMDGPU (LIBOMPTARGET_AMDGPU_GENERIC_SPMD_TEAMS_PER_CU).
libomptarget reads the number of compute units and the platform backend
of the device through liboffload, as part of its geometry properties.

This is an upstream port of the corresponding downstream.

Claude assisted with this patch.
DeltaFile
+53-5offload/libompaccsupport/device.cpp
+56-0offload/test/offloading/generic_spmd_grid.c
+11-0openmp/docs/design/Runtimes.md
+4-0offload/include/device.h
+124-54 files

LLVM/project 79c221e — llvm/lib/Target/AArch64 AArch64Combine.td, llvm/lib/Target/AArch64/GISel AArch64PreLegalizerCombiner.cpp

[AArch64][GlobalISel] Combine load+shuffles to LD2/3/4 (#230438)

Similar to #228514, this adds a combine to form a LD2/LD3/LD4 from a
load and shuffles. We start from the load and look at the uses, as we
need to match multiple shuffles. The intent is that this can be easily
extended to deinterleave intrinsics too when they are available in
gisel.
DeltaFile
+46-157llvm/test/CodeGen/AArch64/interleaved-accesses.ll
+56-123llvm/test/CodeGen/AArch64/zext-shuffle.ll
+154-0llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
+13-19llvm/test/CodeGen/AArch64/vldn_shuffle.ll
+10-1llvm/lib/Target/AArch64/AArch64Combine.td
+279-3005 files

LLVM/project cf76a86 — llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 sve-intrinsics-and-not.ll

[AArch64][llvm] Combine SVE AND-NOT operations into BIC for _m forms

Replace NOT followed by merging AND with BIC for expressions such as:

  return svand_u32_m(pg, a, svnot_u32_x(pg, b));

Combine when NOT is the second operand and its predicate matches the AND
predicate or is all-active.

Use predicated BIC to preserve the AND's first operand in inactive
lanes. Use unpredicated BIC when the AND predicate is all-active.

Do not commute merging AND operands, since this would change inactive
results. Leave pairs with incompatible predicates unchanged.

This applies to all integer element widths. Update the pre-commit LLVM
expectations, including cases where combining would change the
result.
DeltaFile
+12-48llvm/test/CodeGen/AArch64/sve-intrinsics-and-not.ll
+22-10llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+34-582 files

LLVM/project ba18184 — offload/include PluginManager.h, offload/libompaccsupport device.cpp PluginManager.cpp

adapt to new olMemcpy host ptr handling and drop host device search
DeltaFile
+0-13offload/libompaccsupport/PluginManager.cpp
+0-6offload/include/PluginManager.h
+2-2offload/libompaccsupport/device.cpp
+2-213 files

LLVM/project b1b0c9d — offload/include PluginManager.h, offload/libompaccsupport device.cpp PluginManager.cpp

[offload] Copy the kernel launch environment with a direct-write memcpy

Claude assisted with this patch.
DeltaFile
+76-0offload/test/offloading/kernel_launch_environment.c
+13-0offload/libompaccsupport/PluginManager.cpp
+9-3offload/libompaccsupport/device.cpp
+6-0offload/include/PluginManager.h
+104-34 files

LLVM/project e510d11 — offload/liboffload/API Memory.td

adapt the new device ptr handling for olMemcpyWithFlags
DeltaFile
+2-2offload/liboffload/API/Memory.td
+2-21 files

LLVM/project 6c13faa — flang-rt/unittests/Runtime Assign.cpp

[flang-rt] Fix CopyOutAssign unit tests on Darwin (#233999)

The flang-rt unittests are built with -D_POSIX_C_SOURCE=200809 on
Darwin, which hides MAP_ANON/MAP_ANONYMOUS in <sys/mman.h>.
This made AllocateAnonymousPages() fall back to mapping /dev/zero,
which Darwin doesn't support (mmap fails with ENODEV), causing the
CopyOutAssign tests that use it to fail.

Define _DARWIN_C_SOURCE before including system headers, as
trampoline.cpp already does, to re-expose the anonymous mapping flags.

Assisted-by: Claude Opus 5.5
DeltaFile
+8-0flang-rt/unittests/Runtime/Assign.cpp
+8-01 files

LLVM/project 65028f9 — clang/lib/AST/ByteCode Interp.h Pointer.cpp, clang/test/AST/ByteCode cxx20.cpp

[clang][bytecode] Lazily run ctor func of local blocks (#233250)

The problem with the attached test case is that a conditional operator
will force initialize the current variable scope, so we know that the
scope is initialized in both arms of the conditional operator. However,
this causes problems if the conditional operator (and thus its force
initialization of the scope) is itself not always executed, e.g. if
preceded by `0 &&`. In that case , the binary operator will skip the
RHS.

Remove the `InitScope` op altogether and simply call
`Block::invokeCtor()` when accessing a local variable for the first
time. This way, we automatically run the ctor, even if the `InitScope`
wasn't reached (if it still existed anyway).
This also allows us to remove a similar workaround from `Pointer.cpp`.



Fixes https://github.com/llvm/llvm-project/issues/232854
DeltaFile
+11-27clang/lib/AST/ByteCode/InterpFrame.cpp
+22-9clang/lib/AST/ByteCode/InterpFrame.h
+0-21clang/lib/AST/ByteCode/Compiler.cpp
+21-0clang/test/AST/ByteCode/cxx20.cpp
+0-12clang/lib/AST/ByteCode/Pointer.cpp
+0-5clang/lib/AST/ByteCode/Interp.h
+54-741 files not shown
+54-777 files

LLVM/project de4dfdd — mlir/include/mlir/Dialect/LLVMIR LLVMTypes.td, mlir/lib/Dialect/LLVMIR/IR LLVMTypes.cpp LLVMMemorySlot.cpp

[mlir][LLVM] Add LLVMStructType::getElementOffset()

Since bb6f7fcb46cd LLVMStructType::getTypeSizeInBits() uses
allocation sizes, but there are a few places where we still
compute field offsets based on store sizes.

This change factors out the computations into a single method,
a counterpart of LLVM's StructLayout::getElementOffset(), so
that all now agree in how they do that.

Also simplify the surrounding code a bit while there.
DeltaFile
+13-43mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
+39-15mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
+33-0mlir/unittests/Dialect/LLVMIR/LLVMTypeTest.cpp
+4-0mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.td
+89-584 files

LLVM/project e39613e — llvm/lib/Target/AArch64 AArch64ISelLowering.cpp AArch64SVEInstrInfo.td

fixup! [AArch64][llvm] Combine SVE AND-NOT operations into BIC for _x forms
DeltaFile
+14-0llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
+0-12llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+14-122 files

LLVM/project a16c596 — clang/test/Driver ppc-abi.c, llvm/include/llvm/TargetParser Triple.h

[Triple] Simplify ELFv2 ABI and Secure PLT handling for FreeBSD (#233047)

FreeBSD 13 is the baseline supported version and it uses the
ELFv2 ABI on big-endian powerpc64 and Secure PLT on 32-bit
powerpc, so drop the OS version checks and treat all FreeBSD
targets as using them.
DeltaFile
+5-8llvm/include/llvm/TargetParser/Triple.h
+0-4clang/test/Driver/ppc-abi.c
+0-1llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+5-133 files

LLVM/project 8c5e15a — clang/lib/Sema SemaTemplate.cpp SemaTemplateDeduction.cpp

[Clang] Use getNonTypeTemplateArgumentType fallback in getTypeOfConstantTemplateParameter (#231983)

Follow-up to c169131b760c (#231599).


Arg.getNonTypeTemplateArgumentType() in
Sema::getTypeOfConstantTemplateParameter when Arg does not name a
constant template parameter, and remove the unnecessary T.isNull() check
in isUndeducedAuto.
DeltaFile
+0-2clang/lib/Sema/SemaTemplate.cpp
+1-1clang/lib/Sema/SemaTemplateDeduction.cpp
+1-32 files

LLVM/project b24ba10 — llvm/lib/Transforms/Scalar StructurizeCFG.cpp

[StructurizeCFG] Remove unused field UA. NFC. (#234146)

Also use `const UniformityInfo` everywhere since we do not update it.
DeltaFile
+5-10llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+5-101 files

LLVM/project 54a02ff — clang/docs ReleaseNotes.md, clang/include/clang/Basic BuiltinsNVPTX.td

[CUDA][NVPTX] Add dp4a/dp2a builtins; define CUDA-13.4's __nv_idp*_impl externs (#233434)

Since CUDA 13.4 `__dp4a/__dp2a_lo/__dp2a_hi` from `sm_61_intrinsics.hpp`
call nvcc-internal device functions and are declared as plain `extern
"C"` in the corresponding header, namely ` __nv_idp4a_{s_s,u_u}_impl,
__nv_idp2a_{lo,hi}_{s_s,u_u}_impl`.

They were implemented as inline assembly before.
As a result, Clang leaves any use of `__dp4a` as an unresolved `.extern`
in the PTX and ptxas fails with

```
  ptxas fatal : Unresolved extern function '__nv_idp4a_s_s_impl'
```

The NVPTX backend already has `llvm.nvvm.idp4a.* / llvm.nvvm.idp2a.*`.
This change:

* Exposes them as builtins: `__nvvm_idp4a_{s,u}_{s,u}` and

    [6 lines not shown]
DeltaFile
+63-0clang/test/CodeGen/builtins-nvptx-sm_61.cu
+28-0clang/lib/Headers/__clang_cuda_intrinsics.h
+24-0clang/lib/CodeGen/TargetBuiltins/NVPTX.cpp
+17-0clang/include/clang/Basic/BuiltinsNVPTX.td
+4-0clang/docs/ReleaseNotes.md
+1-1llvm/include/llvm/IR/IntrinsicsNVVM.td
+137-16 files

LLVM/project 913f62e — mlir/lib/Interfaces ControlFlowInterfaces.cpp, mlir/unittests/Interfaces ControlFlowInterfacesTest.cpp

[mlir] Fold traverseRegionGraph into isRegionReachable (NFC)

traverseRegionGraph had one caller, and that caller's stop condition only
compared against the target region. Inline it into isRegionReachable as a
plain worklist search. Drop the "has no parent op" error path, which cannot
fire because every region on the worklist comes from the op's own
getSuccessorRegions. insideMutuallyExclusiveRegions now returns early when
both ops are in the same region instead of running both searches first.

Assisted-by: Claude Code (Opus 5.5).
DeltaFile
+30-70mlir/lib/Interfaces/ControlFlowInterfaces.cpp
+14-0mlir/unittests/Interfaces/ControlFlowInterfacesTest.cpp
+44-702 files

LLVM/project 8775913 — libcxx/include/__utility small_buffer.h

[libc++] Replace __libcpp_allocate with std::allocator in small_bufer.h (#234158)

We use `__libcpp_allocate` and frineds only in very specific
circumstances. Instead of providing a private API we can make
`std::allocator` the default API for the uses of `__libcpp_allocate`.
This is a step towards that goal.
DeltaFile
+3-2libcxx/include/__utility/small_buffer.h
+3-21 files

LLVM/project 69ad76c — llvm/test/Transforms/LoopVectorize/WebAssembly int-mac-reduction-costs.ll memory-interleave.ll, llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel loop-02-bb1176.ll int-mac-reduction-costs.ll

[NFC][WebAssembly] Partial reduce precommit tests (#234142)

Create a CostModel directory for our LoopVectorize tests. Integer MAC
tests have been updated to look at more costs.
DeltaFile
+0-3,634llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
+3,634-0llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/memory-interleave.ll
+905-0llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/int-mac-reduction-costs.ll
+348-0llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/loop-02-bb1176.ll
+0-326llvm/test/Transforms/LoopVectorize/WebAssembly/int-mac-reduction-costs.ll
+4,887-3,9605 files

LLVM/project 5156e8b — libc/src/sched/linux CMakeLists.txt getcpu.cpp, utils/bazel/llvm-project-overlay/libc BUILD.bazel

[libc] Use a syscall wrapper for getcpu
DeltaFile
+13-0utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+4-6libc/src/sched/linux/getcpu.cpp
+4-1libc/src/sched/linux/CMakeLists.txt
+21-73 files

LLVM/project 346da8d — clang/include/clang/StaticAnalyzer/Core/PathSensitive CheckerContext.h

[analyzer] Default to fresh state in addTransitionImpl (#234123)

When `CheckerContext::addTransitionImpl` is called with a null `State`,
it defaulted to using the state of the node that was passed to the
constructor of `CheckerContext` -- even if the parent of the new node
(`P`) was another more recent node.

This logic could have "jumped back" to a slightly older, obsolete state
in the case when the state of `P` was distinct from the state of the
node that was passed to the constructor of `CheckerContext`. I did not
observe this in practice (and I verified that it never happens among the
LIT tests), but it is better to completely rule it out.

Using the state of `P` should be a very safe fallback choice, so I don't
expect disruptions from this change. A checker has to be _very_ buggy if
this change (i.e. _not_ forgetting its state updates) triggered buggy
behavior in it.
DeltaFile
+1-5clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+1-51 files

LLVM/project 6368446 — llvm/lib/Target/AArch64 AArch64FrameLowering.cpp, llvm/test/CodeGen/AArch64 sme-vg-to-stack.ll sme2-intrinsics-int-dots.ll

[AArch64] Enable quad variant st1b/ld1b for callee-saved spills (#225100)

Currently, only the pair variant is generated by callee-saved spills.
Generate quad variants when:
- 4 consecutive registers  (example: z8, z9, z10, z11)
- First register will be divisible by 4. (example: z8)
- Offset will be divisible by 4. (example: 4, mul vl)
- Offset in range -32 to 28

A correction was also made in the expensive checks block, where I
corrected the c.Reg1 == PPR to c.Type == PPR
DeltaFile
+192-368llvm/test/CodeGen/AArch64/sme2-intrinsics-ldnt1.ll
+192-368llvm/test/CodeGen/AArch64/sme2-intrinsics-ld1.ll
+38-76llvm/test/CodeGen/AArch64/sve-callee-save-restore-pairs.ll
+84-27llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+16-32llvm/test/CodeGen/AArch64/sme2-intrinsics-int-dots.ll
+12-24llvm/test/CodeGen/AArch64/sme-vg-to-stack.ll
+534-8957 files not shown
+559-94013 files

LLVM/project 899f3a8 — llvm/lib/Transforms/Instrumentation HWAddressSanitizer.cpp, llvm/test/Instrumentation/HWAddressSanitizer disable-sanitizer-instrumentation.ll

[Sanitizers] Update more sanitizers to respect disable_sanitizer_instr (#233596)

Update various sanitizer to respect disable_sanitizer_instrumentation
and not instrument such functions.

In preparation to use it to avoid instrumenting oracle functions,
see https://github.com/llvm/llvm-project/pull/226669.

PR: https://github.com/llvm/llvm-project/pull/233596
DeltaFile
+16-0llvm/test/Instrumentation/HWAddressSanitizer/disable-sanitizer-instrumentation.ll
+14-0llvm/test/Instrumentation/Instrumentor/disable-sanitizer-instrumentation.ll
+14-0llvm/test/Instrumentation/TypeSanitizer/disable-sanitizer-instrumentation.ll
+14-0llvm/test/Instrumentation/RealtimeSanitizer/disable-sanitizer-instrumentation.ll
+14-0llvm/test/Instrumentation/NumericalStabilitySanitizer/disable-sanitizer-instrumentation.ll
+5-1llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+77-14 files not shown
+87-110 files

LLVM/project 186e70f — clang-tools-extra/clangd/refactor/tweaks ExtractFunction.cpp, clang-tools-extra/clangd/unittests/tweaks ExtractFunctionTests.cpp

[clangd] Extract to function: Suppress pure forwarding wrappers (#232654)

Extracting a single statement that's just a lone call (or a return of
one), where every operand that would need to become a parameter is
already exactly that parameter value unchanged, produces nothing but a
renamed call: `foo(x);` becomes `void extracted(int x) { foo(x); }`
called as `extracted(x);`, with no abstraction gained. A value-less
`return;` is the same kind of no-op: there's nothing to abstract over
at all. Both are now rejected.

This is deliberately narrow and per-operand, not a naive argument-count
check: `foo(100)` (a literal), `foo(globalVar)` (an already-visible
global), and `foo(x + y)` (real computation) are all still offered,
since each does something a plain rename wouldn't.

Assisted-by: Claude Code
DeltaFile
+303-17clang-tools-extra/clangd/unittests/tweaks/ExtractFunctionTests.cpp
+143-3clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
+446-202 files

LLVM/project 4c740d2 — clang/test/Parser c2y-if-decl-while.c

[Clang][C2y] Fix pre-c2y-compat expectations in c2y-if-decl-while.c

The -std=c2y run line passes -Wpre-c2y-compat, so the compat form of the
'if'/'switch' declaration diagnostic fires. Give that run a 'compat'
prefix and expect the warnings.

Co-Authored-By: Claude Fable 5.1 <noreply at anthropic.com>
DeltaFile
+5-3clang/test/Parser/c2y-if-decl-while.c
+5-31 files

LLVM/project 0b4338d — llvm/tools/sancov sancov.cpp

[sancov][NFC] Store raw coverage addresses in a DenseSet

Union inserts the same addresses over and over. A std::set walks a tree for every one of them. A hash set checks whether the address is already present in one step. Sort once on output so the bytes stay ordered. On 5,000 llc dumps, union went from 39s to 5s.

Assisted-by: Cursor (Grok 4.7)
DeltaFile
+22-15llvm/tools/sancov/sancov.cpp
+22-151 files

LLVM/project 9145f3d — llvm/tools/sancov sancov.cpp

[sancov][NFC] Append a coverage file into an existing address set

Union was reading each .sancov file into its own address set and then
inserting that set into the union. Read the file straight into the
caller's set instead. append returns the file header so a bitness
mismatch still warns, and read is implemented on top of it.

Assisted-by: Cursor (Grok 4.7)
DeltaFile
+20-16llvm/tools/sancov/sancov.cpp
+20-161 files

LLVM/project b0b3f57 — llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/Analysis/CostModel/X86 arith-mulh.ll

[X86] Remove v4i64 S/UMUL_LOHI lowering and consistently rely on MULHS/U (#231976)

Improve the MULH lowering logic - only scalarize if i64 MUL is legal
(i.e. 64-bit target) and vXi64 VPMULLQ isn't, - always for MULHS and
only for MULHU if the operands have other uses.

v8i64 is always better to stay on the FPU as scalarization is so messy,
even if we don't have VPMULLQ.
DeltaFile
+36-57llvm/test/CodeGen/X86/mulhu-v4i64-umul-lohi-guard.ll
+11-12llvm/lib/Target/X86/X86ISelLowering.cpp
+4-4llvm/test/Analysis/CostModel/X86/arith-mulh.ll
+51-733 files

LLVM/project cfff07d — llvm/lib/CodeGen TargetPassConfig.cpp, llvm/lib/Passes CodeGenPassBuilder.cpp

CodeGen: Stop running LiveVariables in the optimized pipeline

Nothing in the optimized register allocation pipeline requires
LiveVariables any more. The pass will subsequently be deleted. The
only tricky part here is dealing with the AMDGPU pipeline previously
using LiveVariables as an insertion point.

Co-authored-by: Claude claude-opus-4.8 <noreply at anthropic.com>
DeltaFile
+31-31llvm/test/CodeGen/AMDGPU/lower-control-flow-live-variables-update.mir
+1-23llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.ll
+1-10llvm/lib/Passes/CodeGenPassBuilder.cpp
+7-4llvm/test/CodeGen/SystemZ/tls-10.mir
+1-9llvm/lib/CodeGen/TargetPassConfig.cpp
+4-4llvm/test/CodeGen/AMDGPU/fncall-implicitdef.ll
+45-8118 files not shown
+50-10624 files

LLVM/project eefa269 — llvm/lib/CodeGen/SelectionDAG ScheduleDAGSDNodes.cpp, llvm/test/CodeGen/SystemZ atomicrmw-udec_wrap.ll

SelectionDAG: Mark physreg defs dead on scheduler-cloned nodes

When the list scheduler clones a node to break a physreg dependency,
the copies share one SDNode, so InstrEmitter can't tell that a copy's
implicit physreg def (e.g. EFLAGS) lost its users and didn't mark it
dead. LiveVariables recomputes it later, but dead flags are most useful
to earlier optimizations.

Instead, mark the def dead at emission time if the copy has no
scheduler edge for it. This lets convertToThreeAddress form LEAs again,
and is a step toward removing LiveVariables.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+22-0llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+2-0llvm/test/CodeGen/SystemZ/atomicrmw-udec_wrap.ll
+24-02 files