LLVM/project 6886a6bflang/include/flang/Optimizer/Builder/Runtime Assign.h, flang/lib/Optimizer/Builder/Runtime Assign.cpp

[flang] - Call _FortranAAssignSimple instead of _FortranAAssign for intrinsic-type array assignments.

This patch adds support for calling _FortranAAssignSimple, a faster-path for array assignments.
`_FortranAAssignSimple` is called when ALL the following conditions are true:
1. Intrinsic element type (not derived type)
2. Matching ranks (no scalar-to-array broadcasting)
3. Non-volatile
4. Not polymorphic
5. Not explicit-length character
6. Not temporary LHS

Otherwise, uses `_FortranAAssign` (or specialized variants like `_FortranAAssignPolymorphic`, `_FortranAAssignExplicitLengthCharacter`).

This is a (perhaps final) part of the fix for https://github.com/llvm/llvm-project/issues/203915
DeltaFile
+287-0flang/test/HLFIR/assign-simple-routing.fir
+46-4flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
+19-13flang/lib/Optimizer/OpenMP/LowerWorkdistribute.cpp
+13-0flang/lib/Optimizer/Builder/Runtime/Assign.cpp
+12-0flang/include/flang/Optimizer/Builder/Runtime/Assign.h
+2-2flang/test/HLFIR/assign-codegen.fir
+379-192 files not shown
+381-218 files

LLVM/project 5bf5520flang-rt/lib/runtime assign.cpp

more formatting fixes
DeltaFile
+3-3flang-rt/lib/runtime/assign.cpp
+3-31 files

LLVM/project 89f2b93clang/lib/StaticAnalyzer/Core ExprEngineCXX.cpp

[analyzer] Fix fragile logic in VisitCXXNewExpr (#213678)

This part of the engine code had assumed that an `evalBind` call always
produced exactly one transition. This was probably always satisfied by
the existing `eval::Bind` checkers (because the code is old and I don't
know about any bugs caused by this), but it was still fragile and
problematic to rely on this undocumented property of checkers.

This commit introduces a `for` loop to ensure that all nodes produced by
`evalBind` are handled in an identical manner (the same way as the
single node was handled previously).

(Note that not passing a `State` to `makeNodeWithBinding` is equivalent
to passing the state of the predecessor node.)

We noticed this problem during the review of the NFC commit
53ee7b167d8aee0a75c1332ca4a6aa037e0869a0 and decided to put this
(arguably non-NFC) change into a separate PR.
DeltaFile
+5-5clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+5-51 files

LLVM/project 31704d8flang/test/Semantics/OpenMP map-modifiers.f90

Add a check for repeated ompx_hold modifier
DeltaFile
+8-0flang/test/Semantics/OpenMP/map-modifiers.f90
+8-01 files

LLVM/project 50f1e37flang-rt/lib/runtime assign.cpp

Fix formatting issues
DeltaFile
+2-3flang-rt/lib/runtime/assign.cpp
+2-31 files

LLVM/project fe41b73llvm/lib/Target/AMDGPU SIISelLowering.cpp AMDGPUInstructionSelector.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.ballot.i32.wave64.err.ll

Reland "[AMDGPU] Fix llvm.amdgcn.ballot with return width != wavefront size" (#213635)

Reverts https://github.com/llvm/llvm-project/pull/212628

This relands #211493, which was reverted because
ockl_dm_alloc/ockl_dm_dealloc in device-libs emit an i32 ballot on
wave64, which GlobalISel cannot select (one bit per lane doesn't fit).
[#212813](https://github.com/llvm/llvm-project/pull/212813) widens the
clang ballot builtins to the wavefront size so a narrower-than-wave
ballot is no longer emitted, fixing the root cause.
DeltaFile
+15-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ballot.i32.wave64.err.ll
+9-2llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+9-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+33-23 files

LLVM/project e701968llvm/lib/Analysis LoopAccessAnalysis.cpp, llvm/test/Analysis/LoopAccessAnalysis num-iters-for-store-load-conflict.ll

[LAA] Properly report strided access preventing store-to-load forwarding (#208791)

Original test by @fhahn in https://github.com/llvm/llvm-project/pull/191867, further reduced here.
Before this change LAA results in

> maximum safe store-load forward width of 32|0 bits

for `i32` accesses, effectively meaning that only `VF == 1` is safe, yet
not explicitly returning `false` from `couldPreventStoreLoadForward`.
This PR fixes that.
DeltaFile
+88-0llvm/test/Analysis/LoopAccessAnalysis/num-iters-for-store-load-conflict.ll
+7-0llvm/lib/Analysis/LoopAccessAnalysis.cpp
+95-02 files

LLVM/project 73a9a45libcxx/test/benchmarks/algorithms/modifying copy.bench.cpp copy_backward.bench.cpp, libcxx/test/benchmarks/containers deque_iterator.bench.cpp

[libc++] Fold deque iterator benchmarks into algorithm benchmarks (#212279)

The deque::iterator benchmarks were not truly about deque::iterator, but
about specialized algorithm implementations we have for segmented
iterators. This patch handles them as such, like we do for other
specialized algorithms like vector<bool>.
DeltaFile
+0-234libcxx/test/benchmarks/containers/deque_iterator.bench.cpp
+18-14libcxx/test/benchmarks/algorithms/modifying/move_backward.bench.cpp
+16-14libcxx/test/benchmarks/algorithms/modifying/move.bench.cpp
+13-9libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp
+11-9libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp
+58-2805 files

LLVM/project 4129e0cflang/include/flang/Optimizer/Builder/Runtime Assign.h, flang/lib/Optimizer/Builder/Runtime Assign.cpp

[flang] - Call _FortranAAssignSimple instead of _FortranAAssign for intrinsic-type array assignments.

This patch adds support for calling _FortranAAssignSimple, a faster-path for array assignments.
`_FortranAAssignSimple` is called when ALL the following conditions are true:
1. Intrinsic element type (not derived type)
2. Matching ranks (no scalar-to-array broadcasting)
3. Non-volatile
4. Not polymorphic
5. Not explicit-length character
6. Not temporary LHS

Otherwise, uses `_FortranAAssign` (or specialized variants like `_FortranAAssignPolymorphic`, `_FortranAAssignExplicitLengthCharacter`).

This is a (perhaps final) part of the fix for https://github.com/llvm/llvm-project/issues/203915
DeltaFile
+287-0flang/test/HLFIR/assign-simple-routing.fir
+46-4flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
+19-13flang/lib/Optimizer/OpenMP/LowerWorkdistribute.cpp
+13-0flang/lib/Optimizer/Builder/Runtime/Assign.cpp
+12-0flang/include/flang/Optimizer/Builder/Runtime/Assign.h
+2-2flang/test/HLFIR/assign-codegen.fir
+379-192 files not shown
+381-218 files

LLVM/project 4a5e982llvm/lib/CodeGen/GlobalISel LegalizerHelper.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-unmerge-values.mir legalize-extract-vector-elt.mir

GlobalISel: Fix floating point unmerge lowering

Bitcast to integer and use integer type for bit twiddling.
DeltaFile
+332-4llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.ll
+126-188llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-extract-vector-elt.mir
+5-4llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values.mir
+5-1llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+468-1974 files

LLVM/project 22e413eflang-rt/lib/runtime tools.cpp assign.cpp, flang-rt/unittests/Runtime Assign.cpp

[flang-rt] - Lightweight runtime assignment function (AssignSimple) for intrinsic-type assignments.

This PR introduces a lightweight assignment runtime path (`_FortranAAssignSimple`) for intrinsic-type arrays
with the goal of reducing compile-time overhead seen primarily in the form of severly increased time taken by LTO.
This PR includes only the changes to the runtime (flang-rt) and as such just with this PR compile-time improvements
will not be visible.

**Problem**

When compiling Fortran code with OpenMP GPU offload and `firstprivate(allocatable_array)`, LLVM's Attributor creates excessive abstract attributes analyzing complex runtime assignment machinery:

**Symptom:**
- **Test case:** 8-element allocatable integer array with `firstprivate` clause
- **Compile time:** 24.97s (vs 0.78s for `private` - **32x slower**)
- **Root cause:** LLVM Attributor analyzing complex Fortran runtime functions

**Why this happens:**

1. `firstprivate` requires copying arrays from host to device

    [43 lines not shown]
DeltaFile
+214-0flang-rt/lib/runtime/assign.cpp
+151-0flang-rt/unittests/Runtime/Assign.cpp
+4-0flang/include/flang/Runtime/assign.h
+1-0flang-rt/lib/runtime/tools.cpp
+370-04 files

LLVM/project 084f648libcxx/test/libcxx/vendor/apple disable-availability.sh.cpp availability-with-pedantic-errors.compile.pass.cpp, libcxx/test/std/time/time.hash time.hash_enabled.pass.cpp

[libcxx][test] Fix a few test conditions (#213512)

libcxx/vendor/apple/{availability-with-pedantic-errors.compile.pass.cpp,disable-availability.sh.cpp}
both require the platform to support availability markup but weren't
labeled as such. std/time/time.hash/time.hash_enabled.pass.cpp has some
leap second tests that are missing the guards <chrono> uses to include
<__chrono/leap_second.h> and will fail if experimental tzdb is set but
the other ones aren't.
DeltaFile
+7-9libcxx/test/std/time/time.hash/time.hash_enabled.pass.cpp
+1-0libcxx/test/libcxx/vendor/apple/disable-availability.sh.cpp
+1-0libcxx/test/libcxx/vendor/apple/availability-with-pedantic-errors.compile.pass.cpp
+9-93 files

LLVM/project e7b958fllvm/include/llvm/CodeGen/GlobalISel LegalizationArtifactCombiner.h, llvm/test/CodeGen/AMDGPU/GlobalISel extractelement.ll fshr.ll

GlobalISel: Add type size guards in tryCombineMergeLike

Bug in LegalizationArtifactCombiner when:
DstSize < UnmergeSrcSize case can create unmerge with one element.
DstSize > UnmergeSrcSize case can end up attempting to create merge
with one source element and hits assert(TmpVec.size() > 1).
DeltaFile
+222-6llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-extract-vector-elt.mir
+55-23llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
+55-23llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
+35-4llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.ll
+8-3llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
+375-595 files

LLVM/project 4484148llvm/test/CodeGen/AMDGPU/GlobalISel legalize-unmerge-values.mir legalize-extract-vector-elt.mir

AMDGPU/GlobalISel: Precommit tests for upcoming bug fix

Here we have:
artifact combiner creating one element unmerge and
unmerge lowering of FP source using FP type for bit twiddling.
DeltaFile
+23-0llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-extract-vector-elt.mir
+21-0llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values.mir
+44-02 files

LLVM/project c9d04c5lld/include/lld/Common BPSectionOrdererBase.inc, lld/test/MachO bp-section-orderer.s

[lld] Report temporal BP profile resolution (#212127)
DeltaFile
+19-0lld/include/lld/Common/BPSectionOrdererBase.inc
+10-1lld/test/MachO/bp-section-orderer.s
+29-12 files

LLVM/project e7713eellvm/docs Extensions.md, llvm/lib/MC MCAsmInfoELF.cpp

[dyndbg][llvm][ELF] Add ELF section type for dynamic debugging (#208803)

Add ELF section type `SHT_LLVM_DYNDBG_ELF` for embedding the "inner"
unoptimized dynamic debugging ELF object within the "outer" optimized
ELF object.

RFC: https://discourse.llvm.org/t/90113
DeltaFile
+12-0llvm/docs/Extensions.md
+5-0llvm/test/tools/llvm-readobj/ELF/section-types.test
+2-0llvm/lib/MC/MCParser/ELFAsmParser.cpp
+2-0llvm/lib/MC/MCAsmInfoELF.cpp
+1-0llvm/lib/ObjectYAML/ELFYAML.cpp
+1-0llvm/lib/Object/ELF.cpp
+23-01 files not shown
+24-07 files

LLVM/project 7279e40third-party/benchmark/test basic_test.cc

[benchmark] Fix -Wunused-but-set-variable warning in basic_test (#213637)

Fix a build error when building benchmark unit tests with modern
GCC/Clang compilers under strict warning options (-Werror).

In `test/basic_test.cc`, the variable `sum` in `BM_OneTemplateFunc` was
assigned but never read, triggering `-Wunused-but-set-variable`.

Silenced the warning by marking sum with `[[maybe_unused]]`, preserving
the benchmark function's logic while ensuring clean build output.

### Description  
Fixes a build error when compiling `third-party/benchmark` unit tests
with modern GCC/Clang compilers under `-Werror`.

In `test/basic_text.cc`, the variable `sum` in `BM_OneTemplatcFunc` was
assigned but never read, triggering `-Wunused-but-set-variable`.

### Solution  

    [13 lines not shown]
DeltaFile
+3-3third-party/benchmark/test/basic_test.cc
+3-31 files

LLVM/project 17fd0c3lldb/test/API/tools/lldb-dap/server TestDAP_server.py

[lldb][test] Give a directly created lldb-dap session the init commands (#213553)

create_debug_adapter passes the commands that carry the configuration
the test suite was invoked with, and a test that builds a
DebugAdapterServer itself got none of them, so that session ran
unconfigured. It matters wherever the suite configures the debugger
through settings, such as pointing a platform at the runtime it
launches.
DeltaFile
+3-1lldb/test/API/tools/lldb-dap/server/TestDAP_server.py
+3-11 files

LLVM/project 786f2eflibcxx/utils libcxx-lit, libcxx/utils/ci run-buildbot

[libc++][CI] run-buildbot and libcxx-lit need a way to pass the paths to cmake and ninja (#213511)

macOS/Xcode don't have cmake or ninja anywhere in a default PATH, so
run-buildbot and libcxx-lit fail unless you do some PATH surgery before
running them. Allow passing them as environment variables instead, so
run-buildbot can be invoked as `CMAKE=$(xcrun --find cmake)
NINJA=$(xcrun --find ninja) CC=$(xcrun --find clang) CXX=$(xcrun --find
clang++) run-buildbot` on macOS. Allow cmake to be passed to libcxx-lit
in a similar fashion.
DeltaFile
+51-31libcxx/utils/ci/run-buildbot
+8-1libcxx/utils/libcxx-lit
+59-322 files

LLVM/project 469dcdfoffload/test .clang-format

[offload][test] Instruct clang-format to not reflow comments (#213696)

Without this, clang-format attempts to reflow check lines in tests,
resulting in broken tests.
DeltaFile
+1-0offload/test/.clang-format
+1-01 files

LLVM/project b237396llvm/lib/Transforms/AggressiveInstCombine AggressiveInstCombine.cpp, llvm/test/Transforms/AggressiveInstCombine/AMDGPU store-merge-addrspace.ll

[AggressiveInstCombine] Don't merge part stores across address spaces
DeltaFile
+102-0llvm/test/Transforms/AggressiveInstCombine/AMDGPU/store-merge-addrspace.ll
+5-1llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
+107-12 files

LLVM/project ab938b4clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp, clang/test/Sema/LifetimeSafety safety.cpp

Merge branch 'users/NeKon69/issue-213435-support-allocating-freeing-functions' into users/NeKon69/issue-213435-builtin-allocating-freeing-functions
DeltaFile
+58-0clang/test/Sema/LifetimeSafety/safety.cpp
+3-2clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+61-22 files

LLVM/project 877c39allvm/lib/Frontend/OpenMP OMPIRBuilder.cpp, mlir/test/Target/LLVMIR openmp-target-in-reduction-debug.mlir

[OpenMPIRBuilder] Handle empty blocks in restoreIPandDebugLoc (#212535)

`restoreIPandDebugLoc` previously only recovered a debug location when
the insertion block was non-empty, using its last instruction. For an
empty block it left the current debug location unchanged so instructions
emitted afterwards could have wrong debug location.

This PR enhance `restoreIPandDebugLoc` to also handle the empty-block
case: when the insertion point is at the end of an empty block,
synthesize a location scoped to the parent function's subprogram
provided the function has debug metadata.

This helps us get a valid debug location when we switch to `CodeGenIP`
in `emitOffloadingArrays` even when `CodeGenIP` is pointing to an empty
`BB`.

Fixes https://github.com/llvm/llvm-project/issues/212488

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+61-0mlir/test/Target/LLVMIR/openmp-target-in-reduction-debug.mlir
+21-6llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+82-62 files

LLVM/project e2c3b4elibsycl/unittests/mock helpers.cpp

[libsycl][Unit] Tighten mock liboffload API argument checks (#211035)

Prior to this patch, unit test default actions for mock liboffload
returned errors when receiving invalid arguments. There are only a few
valid scenarios where the runtime should expect and handle error codes
returned by liboffload (for example, checking whether a pointer is USM
or not). In most cases, the calls should not be made with invalid
arguments by libsycl at all, and especially not with the type of invalid
arguments that we can check for in default actions, like nullptrs or
invalid size values.

This patch changes such default action checks to trigger test failures
directly instead of mocking error codes.
DeltaFile
+68-109libsycl/unittests/mock/helpers.cpp
+68-1091 files

LLVM/project 3edb821llvm/test/CodeGen/X86 vector-compare-any_of.ll vector-compare-all_of.ll

[X86] vector-compare-all_of/any_of - updates tests to use reduction intrinsics (#213683)

These more closely match middle-end IR and currently expand to the
existing shuffle/bitcast patterns.
DeltaFile
+75-219llvm/test/CodeGen/X86/vector-compare-any_of.ll
+75-219llvm/test/CodeGen/X86/vector-compare-all_of.ll
+150-4382 files

LLVM/project dfcd28doffload/plugins-nextgen/common/include APIHelpers.h, offload/plugins-nextgen/cuda CMakeLists.txt

[offload] Add `dlwrap::loaded` function to check for optional symbols (#210737)

This PR adds a new template into `dlwrap` namespace that can be used to
check if a symbol was correctly loaded. It adds and easy way to see if
version of shared object in a system has required capability. We could
use it to improve prefetch in CUDA backend as noted
[here](https://github.com/llvm/llvm-project/blob/main/offload/plugins-nextgen/cuda/src/rtl.cpp#L912)
without breaking compatibility with older platforms using CUDA older
than 13.

In the case of prefetch, the new `dlwrap` API could be used like: 
```cpp
bool BatchedPrefetchAvailable = dlwrap::loaded<cuMemPrefetchBatchAsync>();
if (BatchedPrefetchAvailable)
    cuMemPrefetchAsync(....)
else
    // Current implementation
```


    [5 lines not shown]
DeltaFile
+57-30offload/plugins-nextgen/level_zero/dynamic_l0/L0DynWrapper.cpp
+58-0offload/plugins-nextgen/common/include/APIHelpers.h
+28-0offload/plugins-nextgen/level_zero/include/L0Compat.h
+10-0offload/plugins-nextgen/level_zero/include/L0CmdListManager.h
+7-1offload/plugins-nextgen/level_zero/CMakeLists.txt
+7-1offload/plugins-nextgen/cuda/CMakeLists.txt
+167-322 files not shown
+178-348 files

LLVM/project 58f3862offload/test/mapping map_ordering_tgt_alloc_present_tofrom.c, offload/test/mapping/present zero_length_array_section.c target.c

[offload] Remove `omptarget` references from tests (#208205)

Make check lines more generic so that we can move and rename components
without breaking the tests

This is in preparation for splitting off parts of libomptarget into
libompaccsupport, which will be used by both OpenACC and OpenMP. Some
debug prints will be printed from `ompaccsupport` and not `omptarget`,
thus the need for this change.
DeltaFile
+29-29offload/test/offloading/struct_mapping_with_pointers.cpp
+7-7offload/test/offloading/force-usm.cpp
+6-6offload/test/mapping/present/target_array_extension.c
+5-5offload/test/mapping/present/zero_length_array_section.c
+5-5offload/test/mapping/present/target.c
+5-5offload/test/mapping/map_ordering_tgt_alloc_present_tofrom.c
+57-5731 files not shown
+126-12637 files

LLVM/project e7b0fbbllvm/docs LangRef.md, llvm/lib/Transforms/InstCombine InstCombineLoadStoreAlloca.cpp

Update for comments.
DeltaFile
+10-10llvm/docs/LangRef.md
+11-0llvm/test/Transforms/InstCombine/atomic.ll
+10-0llvm/test/Transforms/LowerAtomic/atomic-load-store-elementwise.ll
+3-0llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+1-0llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
+35-105 files

LLVM/project deecdb9llvm/test/Transforms/SLPVectorizer/AArch64 alt-addsub-signflip.ll

[SLP][NFC]Add extra test with alternate add/sub vectorization, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/213693
DeltaFile
+58-0llvm/test/Transforms/SLPVectorizer/AArch64/alt-addsub-signflip.ll
+58-01 files

LLVM/project e1b9d11llvm/lib/Target/AMDGPU SILowerSGPRSpills.cpp, llvm/test/CodeGen/AMDGPU wwm-regalloc-error.ll sgpr-spill-vmem-large-frame.mir

[AMDGPU] Support partial and empty WWM pools for SGPR spills

SGPR lane spilling currently treats the WWM VGPR pool as all-or-nothing. This
can fail compilation when the requested pool cannot be formed, even though
scratch spilling or a smaller spillable pool could make progress.

This PR lets ordinary SGPR spills fall back to scratch when the pool is empty
and lets WWM register allocation use a nonempty partial pool. It keeps the
full-pool requirement for strict WWM/WQM and explicit spill-carrier
preallocation.

The no-pool fallback is recorded in SIMachineFunctionInfo so frame lowering can
provide enough emergency scavenging slots. The state is also serialized to
preserve the behavior across MIR round trips.
DeltaFile
+219-0llvm/test/CodeGen/AMDGPU/wwm-regalloc-memory-fallback.ll
+95-49llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+101-0llvm/test/CodeGen/AMDGPU/wwm-regalloc-preallocation-guard.mir
+50-0llvm/test/CodeGen/AMDGPU/wwm-regalloc-partial-pool.mir
+48-0llvm/test/CodeGen/AMDGPU/sgpr-spill-vmem-large-frame.mir
+0-29llvm/test/CodeGen/AMDGPU/wwm-regalloc-error.ll
+513-786 files not shown
+550-8712 files