LLVM/project 81a2a88 — clang/lib/Sema SemaOpenACC.cpp, clang/test/SemaOpenACC combined-construct.cpp

[OpenACC] Fix iterator-type lookup when kind is incomplete (#240424)

OpenACC loop needs to have a random access iterator, and does some
heroics to look into the 'iterator_category' to check for this. It ALSO
checks whether the type referred to in the iterator_category inherits
from std::random_access_iterator.

However, it was failing to make sure it was a definition before checked
for base classes, leading to an assert.

This patch adds that check, which will make a iterator category
incomplete type not attempt to check the 'base' class.

Fixes: #239962
DeltaFile
+22-0clang/test/SemaOpenACC/combined-construct.cpp
+4-3clang/lib/Sema/SemaOpenACC.cpp
+26-32 files

LLVM/project ecd1499 — clang/lib/CodeGen CGDebugInfo.cpp

[clang] Call getOrCreateFile() just once in AddStringLiteralDebugInfo() (#240382)

getOrCreateFile(Loc) is stored in a variable `File` 3 lines up,
so use that variable instead of calling the function again.

Mostly for code cleanliness, but for usb_ids_gen.cc (from #229808)
this is also a small (0.4%) reduction in retired instructions.

No behavior change.
DeltaFile
+2-2clang/lib/CodeGen/CGDebugInfo.cpp
+2-21 files

LLVM/project e20fe3b — llvm/test/CodeGen/ARM bf16-instructions.ll, llvm/test/CodeGen/Thumb2 bf16-instructions.ll

[ARM] Update working abs and neg tests in bf16-instructions.ll. NFC (#240441)

These appear to already be working, with and without +bf16.
DeltaFile
+46-8llvm/test/CodeGen/ARM/bf16-instructions.ll
+0-45llvm/test/CodeGen/Thumb2/bf16-instructions.ll
+46-532 files

LLVM/project 0f6dc59 — libcxx/utils/ci/lnt machines.json

[libcxx] Switch to llvm-premerge-linux-4-runners for benchmarking (#239065)

These are smaller so take up less resources when we only run benchmarks
on a single thread and they are also c2d vs n2/n2d which means that we
get exclusive cores rather than GCP overcommit.

Fixes #236840
DeltaFile
+1-1libcxx/utils/ci/lnt/machines.json
+1-11 files

LLVM/project b2b2297 — libc/src/__support/OSUtil/linux/syscall_wrappers copy_file_range.h, libc/src/unistd copy_file_range.h

[libc] Reland "Implement copy_file_range in unistd" (#240018)

This patch relands #236914 (reverted in #238956 / commit 53d0afa56861).

### Root Cause & Fix
The revert was caused by pre-commit CI failures where
`copy_file_range_test` encountered environments lacking
`copy_file_range` syscall emulation or running on container overlay
filesystems:
- Emulators return `EFAULT` or `ENOSYS` instead of `EBADF` on invalid
descriptors with `nullptr`.
- Container overlayfs / older kernels may return `EXDEV`, `ENOSYS`, or
`EOPNOTSUPP`.

### Changes in Reland
- Update `InvalidArgs` in `copy_file_range_test.cpp` to accept
`any_of(EBADF, EFAULT, ENOSYS)`.
- Gracefully handle `ENOSYS`, `EXDEV`, and `EOPNOTSUPP` in test copy
cases.

    [4 lines not shown]
DeltaFile
+143-0libc/test/src/unistd/copy_file_range_test.cpp
+53-0libc/src/__support/OSUtil/linux/syscall_wrappers/copy_file_range.h
+39-0libc/src/unistd/linux/copy_file_range.cpp
+29-0libc/src/unistd/copy_file_range.h
+20-0libc/test/src/unistd/CMakeLists.txt
+17-0libc/src/unistd/linux/CMakeLists.txt
+301-07 files not shown
+344-513 files

LLVM/project 5647ca3 — clang/lib/CodeGen BackendUtil.cpp, llvm/include/llvm/Passes RunCodeGen.h

[LTO][NFC] Use runCodeGenPipeline

This abstracts across the LegacyPM and the NewPM. We add a new optional
parameter to runCodeGenPipeline to take in a ModuleSummaryIndex to
properly handle pipeline setup.

Reviewers: aengelke, teresajohnson

Pull Request: https://github.com/llvm/llvm-project/pull/240252
DeltaFile
+10-28llvm/lib/LTO/LTOBackend.cpp
+19-4llvm/lib/Passes/RunCodeGen.cpp
+5-4clang/lib/CodeGen/BackendUtil.cpp
+2-0llvm/include/llvm/Passes/RunCodeGen.h
+36-364 files

LLVM/project 042f011 — llvm/lib/LTO ThinLTOCodeGenerator.cpp

[NFC][ThinLTO] Use runCodeGenPipeline abstraction (#240226)

This makes the code slightly simpler by moving to a canonical
abstraction and also abstracts between the LegacyPM/NewPM without
additional handling specific to ThinLTO.
DeltaFile
+5-9llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+5-91 files

LLVM/project caf7fd4 — lldb/source/Core ThreadedCommunication.cpp, lldb/test/API/commands/process/detach-launched Makefile main.c

[lldb] Interrupt the read thread when stopping it

ThreadedCommunication::StopReadThread clears m_read_thread_enabled and
joins the read thread, which checks that flag only once its read
returns. When no data comes, the read returns only when it times out,
after five seconds.

Before lldb reports that a process it launched has exited or that it
detached from the process, it stops the read thread of the process's
terminal. A process that lldb detaches from usually keeps running, and
if it does not write to its terminal, the detach takes five seconds.
StopSTDIOMonitoring closes lldb's own descriptor for the secondary side
of the terminal first, but that ends the read only once the process has
closed its descriptors too. Meanwhile, debugserver or lldb-server exits,
and since the process is not detached yet, ProcessGDBRemote gives it an
exit status, so lldb reports that the process exited.

Interrupt the read after clearing the flag, as SynchronizeWithReadThread
does. A connection reports an interrupt only when no data is pending,

    [3 lines not shown]
DeltaFile
+27-0lldb/test/API/commands/process/detach-launched/TestDetachLaunched.py
+9-0lldb/test/API/commands/process/detach-launched/main.c
+5-0lldb/source/Core/ThreadedCommunication.cpp
+3-0lldb/test/API/commands/process/detach-launched/Makefile
+44-04 files

LLVM/project e5bf923 — lldb/source/Host/macosx/objcxx Host.mm, lldb/test/API/macosx/posix_spawn arm64e.c Makefile

Revert "[lldb] Honor the arm64 subtype when launching on Darwin (#239423)"

This reverts commit 3e7841ef1d6fc5f1aa71eadfa410a781a65329c3.
DeltaFile
+16-43lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
+18-16lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+1-6lldb/test/API/macosx/posix_spawn/Makefile
+0-5lldb/test/API/macosx/posix_spawn/arm64e.c
+1-2lldb/tools/debugserver/source/DNB.cpp
+1-0lldb/source/Host/macosx/objcxx/Host.mm
+37-726 files

LLVM/project 8b1d93b — .github/workflows libc-shared-tests.yml compiler-rt-libc-builtins-tests.yml

[libc] Enable baremetal Armv7-M pre-merge tests (#233498)

The tests are run using QEMU system emulation on x86 GitHub runners.
DeltaFile
+3-3.github/workflows/libc-overlay-tests.yml
+3-3.github/workflows/libc-fullbuild-tests.yml
+2-2.github/workflows/libc-shared-tests.yml
+2-2.github/workflows/compiler-rt-libc-builtins-tests.yml
+10-104 files

LLVM/project c39e503 — llvm/lib/Target/RISCV RISCVInstrInfoP.td, llvm/test/CodeGen/RISCV rvp-simd-32.ll rvp-simd-64.ll

[RISCV][P-ext] Add vector isel patterns to match merge from and/or/vnot. (#240223)

Assisted-by: Claude
DeltaFile
+54-2llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+24-0llvm/test/CodeGen/RISCV/rvp-simd-32.ll
+9-4llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+87-63 files

LLVM/project 74c9dd2 — clang/lib/CIR/CodeGen TargetInfo.cpp, clang/lib/CIR/CodeGen/Targets NVPTX.cpp

[CIR][SYCL] Fix null value emission in local addrspace for AMD and NVPTX targets (#237387)

Fixes null value emission bug in local address space for AMDGPU and
NVPTX targets. This is needed to port the following 2 tests from clang
CodeGenSYCL to CIR CodeGenSYCL:
- amd-address-space-conversions.cpp
- cuda-address-space-conversions.cpp
DeltaFile
+247-0clang/test/CIR/CodeGenSYCL/amd-address-space-conversions.cpp
+197-0clang/test/CIR/CodeGenSYCL/cuda-address-space-conversions.cpp
+25-0clang/lib/CIR/CodeGen/Targets/NVPTX.cpp
+15-0clang/lib/CIR/CodeGen/TargetInfo.cpp
+484-04 files

LLVM/project fe51913 — llvm/test/CodeGen/RISCV calling-conv-lp64.ll calling-conv-lp64e.ll

[RISCV] Fix dead code in calling-conv-lp64(e).ll. NFC (#240101)

Flagged in the review of #239884.
DeltaFile
+5-1llvm/test/CodeGen/RISCV/calling-conv-lp64e.ll
+3-1llvm/test/CodeGen/RISCV/calling-conv-lp64.ll
+8-22 files

LLVM/project 0cddc60 — llvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution max-backedge-taken-count-guard-info-operand-order.ll

[SCEV] Drop redundant umax when applying signed lower-bound guards. (#237779)

When applying a guard From s>= RHS with a non-negative constant RHS,
From u>= RHS holds as well. If From has already been rewritten to
umax(C, From) with C u<= RHS, the umax is redundant and can be dropped.

This avoids losing range information, as the range of umax(C, From) may
be much less precise than the range of From when using SMax.

More precise range enables additional unrolling end-to-end
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1923.

PR: https://github.com/llvm/llvm-project/pull/237779
DeltaFile
+187-0llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info-operand-order.ll
+11-1llvm/lib/Analysis/ScalarEvolution.cpp
+198-12 files

LLVM/project af5606d — llvm/lib/Target/RISCV RISCVOptWInstrs.cpp RISCVISelDAGToDAG.cpp, llvm/test/CodeGen/RISCV opt-w-instrs-p-ext.mir rvp-scalar-rv64.ll

[RISCV][P-ext] Add PseudoMERGE to hasAllNBitUsers. (#240219)

Assisted-by: Claude
DeltaFile
+32-0llvm/test/CodeGen/RISCV/rvp-scalar-rv64.ll
+28-0llvm/test/CodeGen/RISCV/opt-w-instrs-p-ext.mir
+1-0llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp
+1-0llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+62-04 files

LLVM/project 0497136 — lldb/packages/Python/lldbsuite/test/make Makefile.rules, lldb/test/API/commands/dwim-print TestDWIMPrint.py

[lldb][test] Build PDB test inferiors with column info (#238604)

Clang emits columns into DWARF line tables by default but leaves them
out of `CodeView` unless `-gcolumn-info` is passed, so pdb test
inferiors have no columns.

This patch passes `-gcolumn-info` for `MAKE_PDB` builds.

Fixes `TestBreakOnCPP11Initializers`, `TestStepThroughTrampoline` and
`TestStructuredBinding` with PDB debug info.

rdar://191741281
DeltaFile
+1-1lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+0-1lldb/test/API/lang/cpp/structured-binding/TestStructuredBinding.py
+0-1lldb/test/API/lang/cpp/step-through-trampoline/TestStepThroughTrampoline.py
+0-1lldb/test/API/lang/cpp/break-on-initializers/TestBreakOnCPP11Initializers.py
+0-1lldb/test/API/commands/dwim-print/TestDWIMPrint.py
+1-55 files

LLVM/project ea64f82 — clang/test/CodeGenHLSL/builtins normalize.hlsl distance.hlsl, clang/test/SemaHLSL/BuiltIns length-errors.hlsl distance-errors.hlsl

[HLSL] Support long vectors in normalize, length, and distance (#239434)

Fixes #224409
Fixes #224403
Fixes #224402
DeltaFile
+36-0clang/test/CodeGenHLSL/builtins/length.hlsl
+34-0clang/test/CodeGenHLSL/builtins/distance.hlsl
+26-0clang/test/CodeGenHLSL/builtins/normalize.hlsl
+13-0clang/test/SemaHLSL/BuiltIns/geometric-long-vector.hlsl
+2-8clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
+2-8clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl
+113-161 files not shown
+116-167 files

LLVM/project 3929a8c — llvm/include/llvm/CodeGen SelectionDAGISel.h, llvm/lib/CodeGen/SelectionDAG SelectionDAGISel.cpp

[SelectionDAG] Add selectShiftAmountMask and use it for RISC-V (NFC) (#240214)

Many targets drop a shift-amount AND that keeps every bit the shift
reads, each with its own code. This moves RISC-V's version into
`SelectionDAGISel::selectShiftAmountMask` so other targets can share it.
X86 uses it next, for #199697.

The helper looks through one truncate and an AND whose constant, with
known-zero bits, keeps the low Log2(width) bits. It sets the output only
on success. It ignores other users of the AND, so each target decides
that.

RKSimon suggested a TableGen-level fix in #199697. This shares the C++
selector behind target ComplexPatterns instead.

RISC-V output does not change.

Assisted-by: Claude Opus 5.5
DeltaFile
+33-0llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+3-28llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+14-0llvm/include/llvm/CodeGen/SelectionDAGISel.h
+50-283 files

LLVM/project ede30f6 — llvm/include/llvm/IR IRBuilder.h, llvm/include/llvm/Transforms/InstCombine InstCombiner.h

[IRBuilder] Add support for GEP canonicalization (#237255)

This implements support for GEP to ptradd canonicalization in IRBuilder:
Arbitrary GEPs will be converted into a sequence of ptradd
(getelementptr i8) or scaled ptradd (getelementptr [N x i8]).

Because this has substantial impact on existing tests, this is currently
off by default, with only InstCombine opting in via
enableGEPCanonicalization(). InstCombine already canonicalizes itself,
so this only changes a few edge-cases.

The plan is to then opt-in a few more places, then convert the opt-in to
an opt-out, and then remove the opt-out.
DeltaFile
+105-1llvm/test/Transforms/InstCombine/getelementptr.ll
+55-0llvm/lib/IR/IRBuilder.cpp
+41-8llvm/include/llvm/IR/IRBuilder.h
+5-7llvm/test/Transforms/InstCombine/scalable-vector-array.ll
+6-6llvm/test/CodeGen/AMDGPU/vector-alloca-bitcast.ll
+3-1llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
+215-231 files not shown
+216-257 files

LLVM/project 62a2650 — llvm/utils/gn/secondary/llvm/lib/CodeGen/SelectionDAG BUILD.gn

[gn] port 3e3ca055b0bb (SelectionDAG tablegen opts) (#240429)
DeltaFile
+10-0llvm/utils/gn/secondary/llvm/lib/CodeGen/SelectionDAG/BUILD.gn
+10-01 files

LLVM/project e2a9335 — mlir/include/mlir/Dialect/GPU/IR GPUDialect.h, mlir/include/mlir/Dialect/MemRef/IR MemRef.h

[mlir][NFC] Remove includes of headers declaring used traits and interfaces (#240404)

The generated declarations of ops, attributes, types and interfaces now
include the headers declaring the core traits and interfaces they use.
Includes that headers only had for these generated declarations are
therefore redundant. This removes them in MLIR, Flang and ClangIR.

Includes of headers that the hand-written code uses directly are kept,
even when the generated code includes them as well.

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+0-11mlir/include/mlir/Dialect/MemRef/IR/MemRef.h
+0-10mlir/test/lib/Dialect/Test/TestOps.h
+0-9mlir/include/mlir/Dialect/Vector/IR/VectorOps.h
+1-8mlir/include/mlir/Dialect/SCF/IR/SCF.h
+0-8mlir/include/mlir/Dialect/Tensor/IR/Tensor.h
+0-8mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
+1-5465 files not shown
+1-26671 files

LLVM/project fd626bb — lldb/test/API/commands/dwim-print TestDWIMPrint.py

fixup! [lldb][test] Build PDB test inferiors with column info
DeltaFile
+0-1lldb/test/API/commands/dwim-print/TestDWIMPrint.py
+0-11 files

LLVM/project dff6968 — clang/lib/CIR/CodeGen CIRGenExprScalar.cpp, clang/test/CIR/CodeGen vector-ext.cpp vector.cpp

[CIR] Use `cir.vec.fcmp` op for logical comparisons (#239706)
DeltaFile
+26-6clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+6-6clang/test/CIR/CodeGen/vector-logical-long-double.cpp
+5-5clang/test/CIR/CodeGen/vector.cpp
+5-5clang/test/CIR/CodeGen/vector-strict-fp.cpp
+4-4clang/test/CIR/CodeGen/vector-ext.cpp
+46-265 files

LLVM/project f3c1281 — clang/lib/CodeGen CodeGenFunction.h CGAtomic.cpp, clang/test/OpenMP amdgpu-unsafe-fp-atomics.cpp target_atomic_device_scope.cpp

[OpenMP] Use device scope for atomic constructs on the device

OpenMP 6.0, 17.8.5 specifies that "The memscope clause determines the
binding thread set for an atomic region. If the memscope clause is not
present, the behavior is as if the memscope clause appeared on the
construct with the device scope-specifier."

Thread the sync scopes through codegen amd also add a release note
because this is changing existing behavior.
Existing behavior was overly cautios for OpenMP 5.2, too, though. The
atomic construct never specified the option of having system-level
scope. This only came with the memscope clause and it's "all"
scope-specifier.

Claude assisted with this patch.
DeltaFile
+130-0clang/test/OpenMP/target_atomic_device_scope.cpp
+24-9clang/lib/CodeGen/CGStmtOpenMP.cpp
+16-11clang/lib/CodeGen/CGAtomic.cpp
+11-10llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+8-8clang/test/OpenMP/amdgpu-unsafe-fp-atomics.cpp
+6-3clang/lib/CodeGen/CodeGenFunction.h
+195-413 files not shown
+205-459 files

LLVM/project 1ae7bb5 — mlir/include/mlir/Dialect/XeGPU/uArch uArchBase.h, mlir/test/Dialect/XeGPU propagate-layout-inst-data.mlir peephole-optimize.mlir

[MLIR][XeGPU] Limit transposed 2D block load height to 16 (#239469)

The hardware supports transposed 2D block loads with height 16 or 32,
but a 32-row tile does not align with the DPAS layout. Limit the
8/16/32-bit transposed block load entries in the uArch table to height
16.

Layout propagation now falls back to inst_data [16, 8] for a transposed
i32 load whose consumer asks for 32 rows, and the peephole optimizer
splits 32-row transposed loads into two 16-row loads.

Add a propagate-layout-inst-data test covering the fallback, and update
the peephole-optimize CHECK lines for the split loads.

assisted-by-claude

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+51-22mlir/test/Dialect/XeGPU/peephole-optimize.mlir
+22-0mlir/test/Dialect/XeGPU/propagate-layout-inst-data.mlir
+5-3mlir/include/mlir/Dialect/XeGPU/uArch/uArchBase.h
+78-253 files

LLVM/project f8ff80a — clang/lib/CodeGen CGStmtOpenMP.cpp, clang/test/OpenMP amdgpu-unsafe-fp-atomics.cpp

[OpenMP][clang] Apply atomic options to atomic compare

Thread denormal mode, fine-grained memory and remote memory options
through for atomic compare directivs.

Claude assisted with this patch.
DeltaFile
+26-14llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+40-0clang/test/OpenMP/amdgpu-unsafe-fp-atomics.cpp
+10-2llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+10-2clang/lib/CodeGen/CGStmtOpenMP.cpp
+86-184 files

LLVM/project 6ae787b — clang/include/clang/Lex ModuleMap.h, clang/lib/Lex ModuleMap.cpp

[clang][Lex][NFC] Remove unused ShadowModules (#239938)

`ModulesAlloc` manages module lifetimes, making `ShadowModules`
redundant.
DeltaFile
+0-3clang/include/clang/Lex/ModuleMap.h
+0-1clang/lib/Lex/ModuleMap.cpp
+0-42 files

LLVM/project a182f80 — llvm/lib/Target/AMDGPU SIFoldOperands.cpp

[AMDGPU] Remove V_CNDMASK_B64_PSEUDO handling from SIFoldOperands. NFC. (#240324)

This is dead because the pseudo always gets expanded earlier, and broken
because it would have used V_MOV_B32 to move a 64-bit value.
DeltaFile
+1-2llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+1-21 files

LLVM/project 5f4db49 — libc/src/__support/threads thread.h, libc/src/__support/threads/linux futex_utils.h thread.cpp

[libc] Apply scheduler attributes on thread creation (#225674)

POSIX specifies that pthread_create should apply the scheduling policy
and parameters given in the attributes object (if PTHREAD_EXPLICIT_SCHED
is set). Linux's clone syscall doesn't support setting scheduling
parameters directly, so we have to apply them from userspace via
sched_setscheduler after the thread is created.

To make sure the thread doesn't start running user code with the wrong
scheduling parameters (and to allow returning an error if
sched_setscheduler fails without leaving a half-running thread), I've
added a startup handshake using the clear_tid futex on the child stack:
- the child waits on the futex if explicit scheduling was requested
- the parent calls setschedparam, and then signals the child to either
continue (running) or abort (exit)
- if the call fails, the child exits immediately, the parent reaps it
via Thread::wait(), and returns the error code to the caller

Assisted-by: Gemini
DeltaFile
+234-0libc/test/integration/src/pthread/pthread_create_test.cpp
+53-9libc/src/__support/threads/linux/thread.cpp
+22-0libc/src/__support/threads/linux/futex_utils.h
+16-2libc/src/pthread/pthread_create.cpp
+6-4libc/src/__support/threads/thread.h
+7-0libc/test/integration/src/pthread/CMakeLists.txt
+338-152 files not shown
+340-158 files

LLVM/project 41e035a — clang/docs ReleaseNotes.md, clang/lib/CodeGen CGStmtOpenMP.cpp

[OpenMP][clang] Add ompx_fast_fp_atomics and ompx_safe_fp_atomics hints

Add omp_sync_hint_t extensions that override
-f[no-]atomic-ignore-denormal-mode (-m[no-]unsafe-fp-atomics) for a single
atomic construct. The safe hint takes precedence if both are given.

This is an upstreaming/copy-paste of downstream code and release notes.

Claude assisted with this patch.
DeltaFile
+71-0clang/test/OpenMP/amdgpu-unsafe-fp-atomics.cpp
+20-0clang/lib/CodeGen/CGStmtOpenMP.cpp
+4-1openmp/runtime/src/include/omp.h.var
+4-0clang/docs/ReleaseNotes.md
+99-14 files