Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW42 2026) - #23529

Merged
bb-sycl merged 3492 commits into
syclfrom
llvmspirv_pulldown
Oct 20, 2026
Merged

bb-sycl merged 3492 commits into
syclfrom
llvmspirv_pulldown

Conversation

@iclsrc

@iclsrc iclsrc commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

ldionne and others added 30 commits September 29, 2026 15:28
…underlying containers (#210730)

This increases the test coverage for stack/queue and actually caught an
issue in list::__invariants which was previously dead code.
Summary:
This existed to handle the OpenMP case that dynamically opened via
`dlsym`. However, llvm/llvm-project#227020
removes the need for this by first checking the global space first.

The main motivation is that the `dlsym` interceptor layer was the most
janky part of this whole affair and was a major blocker to supporting
`-shared-libsan` in llvm/llvm-project#226551.
Use arith.convertf in convertScalarToDtype when converting between
floating-point types that have the same bit width but different
semantics.

Add focused unit coverage for f16-to-bf16 and bf16-to-f16 conversions.

Assisted-by: Codex
…k (#221821)

MachineBlockPlacement aligns the backedge destination after loop
rotation, which may not be the LoopInfo header. Query that block for the
32-byte request and the 4-byte pad cap so they stay consistent.
## Summary
- Pass the block being aligned into `getPrefLoopAlignment` so gfx950
fetch-window alignment uses the backedge destination, not only the
LoopInfo header.
- Unrotated 8-byte headers still get capped.
- Rotated 4-byte landing pads are no longer given uncapped 32-byte
alignment.
On AArch64 there are assembly files that need CMAKE_ASM_COMPILER_TARGET
and CMAKE_ASM_FLAGS_INIT set
This patch moves the definition of DenseMapIterator right above
DenseMapBase so that all classes in DenseMap.h are defined in the
bottom-up order without forward declarations:

- DenseMapStorage
- SmallDenseMapStorage
- DenseMapIterator
- DenseMapBase
- DenseMap
- SmallDenseMap

Assisted-by: Antigravity
… out of `buildSchedGraph` (#226533)

Continuing the groundwork for a proper implementation of #205689, factor
the control dependency construction state and logic out of
`ScheduleDAGInstrs` into a friend class. This will also enable us to
further break up `buildSchedGraph` to make, e.g., the barrier chain
handling easier to comprehend.
…#227185)

acc.loops could have negative steps, but ACCLoopTiling computed each
element loop's bound assuming an ascending one. Both halves of that
computation were wrong for a descending dimension: the inclusive edge
subtracted one instead of adding one, and the bound was clamped with min
instead of max.

For `DO j = n, floor, -1` under `tile(32)`, the last tile's bound came
out as `min(floor, j - 33)`, which selects `j - 33` whenever it falls
below the floor. The element loop then ran past the end of the iteration
space, reading and writing outside the array.

With this change, we pick the clamp and the inclusive edge from the
step's direction. When the sign is only known at runtime, we compute
both and select on it.

The tiling tests had no coverage of negative steps or of inclusive upper
bounds. This patch adds four new tests: descending, descending with an
inclusive bound, ascending with an inclusive bound, and a runtime-signed
step.
The conversion of Clang attribute documentation from reST to MyST
markdown did not transform markup correctly in all cases. Additionally,
some PRs that were originally authored for reST were merged after the
conversion resulting in reST formatted markdown getting re-introduced.
This change corrects all such cases the author was able to identify,
applies markup that was previously missing, corrects a few typos along
the way, and even adds a missing attribute documentation reference that
has prevented the `#pragma clang loop` `pipeline` and
`pipeline_initiation_interval` documentation from being published since
2019.
…227038)

Fixes #226673

--- 

This patch addresses the issue in which an invalid friend function
template is instantiated as a valid declaration, leading to a crash upon
a later redeclaration.

---

This fixes a regression introduced by
llvm/llvm-project#216555
The function already has an early return after failed allocation.
This is covered by InstCombine for the motivating benchmark.
…#227207)

The last caller of DIE::setForceChildren was removed on March 6, 2017
in commit a175512, leaving
DIE::ForceChildren always false.

Assisted-by: Antigravity
…277)

`PlatformWindows::DebugProcess` and `PlatformWindows::Attach` create the
Process and hijack its events, but never call
`Process::SetShadowListener` with the listener from the launch or attach
info. `PlatformPOSIX`, `PlatformRemoteGDBServer` and `Target::Launch`'s
all do.

On Windows a shadow listener set with `SBLaunchInfo::SetShadowListener`
therefore never gets an event, which is why
`TestEvents.test_shadow_listener` failed on every run (`"Shadow listener
got event too"`) on both the lldb-server and the in-process backend.
    
Call `SetShadowListener` in both, and in Attach only touch `process_sp`
once it is known to be non-null (HijackProcessEvents was called before
the null check).

I was able to reproduce the failure at desk on a machine that's under
load. The issue no longer reproduces after this patch.

Fixes llvm/llvm-project#37721.

rdar://188700614
Another test for the fix from #227289, which hit a different
assert condition.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
…#227299)

The in-process Windows plugin printed `x86`/`x64` registers in uppercase
hex, unlike every other register table.

`Test11588` compares against lowercase hex, so it only passed when the
address happened to have no letters.

This patch uses lowercase hex, matching `lldb-server`. Test11588 is
re-enabled.
…er (#211071)

Extend the generic `__kmp_invoke_microtask` implementation to support up
to 32 microtask arguments.

The generic dispatcher currently handles at most 15 arguments. OpenMP
regions with more captured variables terminate at runtime.

This affects WebAssembly because call_indirect requires the callee type
to exactly match the call-site type. Unlike assembly dispatchers on
platforms such as x86_64, the generic C++ implementation cannot
construct an arbitrary-arity call dynamically and must provide each
supported signature explicitly.
Real-world OpenMP regions can exceed the existing limit; the motivating
cases require between 16 and 21 arguments.

A longer-term alternative would be to change the compiler/runtime
convention for generic-dispatch targets so captured-variable pointers
are passed through a single packed context argument. That would remove
the fixed upper bound, but it would require coordinated Clang and OpenMP
runtime changes and consideration of compatibility with objects produced
using the existing variadic microtask ABI. This change keeps the
existing ABI and provides a focused runtime-only fix.
ARMTargetMachine overrode the default float abi based on the abi name.
Move this logic to TargetParser so the ABI will be computable without
depending on codegen.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…lowering (#227105)

These have equivalent behavior, but pncvt.h/pncvth.h requires the input
to be a register pair. Shuffle lowering doesn't know if the sources came
from the same 64-bit value so using pncvt.h/pncvth.h may overconstrain
register allocation and require copies.

If some hardware has better performance for pncvt.h/pncvth.h we
can consider ways to intelligently pick the two alternatives. For
now just pick pack/ppairo.h.
The rationale and methodology are the same as in
0351190 just in `clang` this time.
…26134)

POSIX specifies that before calling a thread-specific key destructor,
the value of the key must be set to NULL (so pthread_getspecific returns
NULL from inside the destructor), and that the destructor pass must
repeat up to PTHREAD_DESTRUCTOR_ITERATIONS times if destructors
re-associate non-NULL values with keys.

This patch sets the key payload to nullptr prior to calling the
destructor, and loops over the key array up to the destructor iteration
limit as long as non-NULL values remain.

Along with that:
- introduce common-threads-macros.h to share the destructor iteration
count (4) between C (TSS_DTOR_ITERATIONS) and POSIX
(PTHREAD_DESTRUCTOR_ITERATIONS), and use it internally
- expose TSS_DTOR_ITERATIONS in threads.h
- expose and implement _SC_THREAD_DESTRUCTOR_ITERATIONS in sysconf

Note that I am not fixing the issue where a deleted key's destructor can
still run on thread exit if it was already cached in thread-local
storage. Fixing that properly will require tracking key generations or
validity across threads, so I'm leaving that for separate work
(#226122).

Fixes #194029.

Assisted-by: Gemini
This test has been failing on AArch64 Linux recently. Either with
SIGSEGV or SIGABRT (less often that one).

I could reproduce it locally by varying system load, and got this out of
a core file:
```
* thread #1, name = 'test_python_sto', stop reason = SIGSEGV: address not mapped to object (fault address=0xc17d18317552db80)
   * frame #0: 0x0000ef7dc72ac6cc libc.so.6`__GI_memchr at memchr.S:68
     frame #1: 0x0000ef7dc727cf4c libc.so.6`_IO_getline_info(fp=0x0000b9b53a8bd180, buf="\xa9\xb4\t\xce}\xef", n=<unavailable>
, delim=10, extract_delim=1, eof=0x0000000000000000) at iogetline.c:85:17
     frame #2: 0x0000ef7dc727bdc4 libc.so.6`_IO_fgets(buf="\xa9\xb4\t\xce}\xef", n=<unavailable>, fp=0x0000b9b53a8bd180) at io
fgets.c:53:11
     frame #3: 0x0000ef7dc80f2b80 liblldb.so.24.0git`lldb_private::IOHandlerEditline::GetLine(std::__cxx11::basic_string<char,
 std::char_traits<char>, std::allocator<char>>&, bool&) + 996
     frame #4: 0x0000ef7dc80f41f4 liblldb.so.24.0git`lldb_private::IOHandlerEditline::Run() + 180
     frame #5: 0x0000ef7dc80bf614 liblldb.so.24.0git`lldb_private::Debugger::RunIOHandlers() + 128
     frame #6: 0x0000ef7dc80ccee8 liblldb.so.24.0git`std::_Function_handler<void* (), lldb_private::Debugger::StartIOHandlerTh
read()::$_0>::_M_invoke(std::_Any_data const&) + 28
     frame #7: 0x0000ef7dc81e1608 liblldb.so.24.0git`lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 124
     frame #8: 0x0000ef7dc72903c8 libc.so.6`start_thread(arg=0x000000000080e640) at pthread_create.c:442:8
     frame #9: 0x0000ef7dc72f9fdc libc.so.6`thread_start at clone.S:79
```
What's happening is that the interpreter's input stream is set to stream
A, then we reset it to the default, then close stream A. There may still
be reads from stream A in flight when we close it, which lead to the
crash.

The solution is to wait on the interpreter thread to finish whatever
it's doing. SBDebuger::Destroy does that.

Normally that would be called by driver.cpp but it can be called on
already destroyed objects. So for this test we'll call it twice, but
that's not a problem.
…hazard) (#214406)

On gfx1250/gfx1251 the V_PERM_PK16 family (V_PERM_PK16_B4/B6/B8_U4) has
a hazard: the instruction must be immediately followed by a "safe"
instruction that issues on the pipe which clears the hazard. Insert
V_NOP as needed.

Also updated hasUnwantedEffectsWhenEXECEmpty() to ensure V_PERM_PK16 and
the inserted V_NOP are under non-zero EXEC.

Fixes: ROCM-26041

Assisted-by: Opus 4.8 Medium
The WIN__CHKSTK custom inserter already marks the clobbered R12 and CPSR
defs dead, but left the call's implicit-def $lr for later inference.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
…261)

Add `-Wfortify-source` diagnostics for `poll`, `ppoll`, and `ppoll64` when the byte size required for `nfds` descriptors (`nfds * sizeof(*fds)`) exceeds the destination `fds` buffer size.

Supersedes the `poll` portion of #177286 (similar to #198130 for `umask`).

Part of #142230

Assisted-by: Gemini
Exclude addresses of GlobalValues in unsupported address spaces.

Assisted-by: Claude.
jsji and others added 14 commits October 17, 2026 05:37
…#3951)

Adds reverse-translation of the new `OpTypeVectorIdEXT` op from
`SPV_EXT_long_vector` extension in the Reader. Its component size must
be a constant instruction
(`OpConstant`/`OpSpecConstant`/`OpSpecConstantOp`).

The goal is to cover `OpTypeVectorIdEXT` for all instructions that can
use `OpTypeVector` type. However, there's a fundamental difference when
it comes to **checking the component count** for these instructions:
- We can't check component count in `validate()` methods of these
instructions, like they do for `OpTypeVector`-typed results/operands,
because the component count is an instruction which must be
translated/evaluated to know the values.
- We can't _fully_ rely on the `spirv-val` to validate component count
for instructions either, because `spirv-val` can't correctly evaluate
specialization constants which can be overriden by users via
TranslatorOpts.

Given these, the component check of `OpTypeVectorIdEXT` for instructions
are performed by the Reader during `transValue`. For the same reason, a
new `SPIRVTypeVectorIdEXT` class is added, since its state and
implementation differ a lot from `SPIRVTypeVector`.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@c14d6264346640c
)

The `SPV_INTEL_function_pointers` extension enables indirect function
calls with function pointer. However, when the
`SPV_KHR_untyped_pointers` is also enabled, all function pointers become
untyped too, and the Reader will crash with assertion error, because it
still assumes the function pointer is always typed.

This PR adds proper handling for untyped function pointer in the Reader
in case of an indirect function call.

In addition, to preserve type information for `byval`/`sret` function
arguments at call site, and also to fix the type mismatch between
function params vs args for a direct function call, the Writer has been
changed to always emit these type-attributed function arguments as
typed, and the Reader assumes that such function arguments remain typed.

AI-assisted by: Claude Opus 4.8

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@31a4f1e1cebda95
Function storage class OpVariable must be first in the entry block, so
`llvm.frexp` call outside the entry block failed spirv-val

Inspired by llvm/llvm-project#189958

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@a4fcec59a778191
Stacked on top of #3991.

When an explicit target triple is specified through
`--spirv-target-triple`, we need to make sure that the addrspace map is
aligned with the specified triple. This PR only adds the addrspace map
for AMDGCN triples, but new ones can be easily added if needed. If there
is no triple specified, or the triple is unknown, we fallback to the
default addrspace map.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@05f238e3f21dae6
Translation of `uinc_wrap` and `udec_wrap` as if they were opaque llvm
intrinsics, so that they can be restored in the reverse translation to
the exact original code. This only applies to AMD targets.

Part 1 of #3945 split.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@c4a6b42303c6b45
Some `checkError` calls checks for non-null pointers, without checking
its return value and no early return if it fails. This is fine if
`SPIRVErrorLog` defaults to abort/exit; however, when it's set to
"ignore" and the pointers are null, it will still continue execution and
end up dereferencing null pointers.

This PR adds the check of the return value and an early return for
`checkError` calls on null pointer checks, for a more graceful failure
instead of a segfault by dereferencing null pointers in "ignore" mode.
These are flagged by our internal static analysis tool and should be
fixed.

NOTE: this PR fixes `checkError` on pointers only, to avoid segfault
when dereferencing null pointers. `checkError` on non-pointer checks
aren't included in this PR, as there are still _many_ inproper
`checkError` calls across the entire repo; fixing them is out of scope
for this PR, and at this point, they aren't as harmful as dereferencing
null pointers.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@c8c0220b2b5d01b
Update after llvm-project commit eebfba9 ("[SPIR-V] Emit NoCapture
function parameter decoration for captures(none) args (#223694)",
2026-09-18).

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@faf929e63427e8a
Mimic SPIR-V backend handling introduced by llvm-project commit
6197875 ("[SPIR-V] Add storage class bits to fence and generic
atomic semantics (#223023)", 2026-09-21).

Also add missing CHECK lines for `fence_test_kernel5`.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@b421837f08eae5b
The writer applies decoration on a call after its translation, to
whatever value it ended up mapped to.
For mini-float conversions (`Float4E2M1EXT`, `Float8E4M3EXT`,
`Float8E5M2EXT`) that's the bitcast to their packed-integer LLVM
representation added afterwards, not the conversion.
Decorate the conversion directly and clear the metadata, so there's
nothing left for the bitcast to pick up.

Once correctly placed, the reader must also route these decorated
conversions through the existing mini-float-aware path instead of the
generic builtin-name mangler.

AI-assisted: Claude Sonnet 5 (commercial SaaS)

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@21886679bea73ce
After c476f80 ("[clang][SYCL] Implement address space attributes for
SYCL"), the OpenCL address space attributes map to the OpenCL LangAS
values in SYCL mode instead of the SYCL ones. The implicitly declared
SPIR-V builtins __spirv_GenericCastToPtrExplicit_To{Private,Local,Global}
use the SYCL address spaces, so the native CPU definitions in
nativecpu_utils.cpp now differ only in their return type and fail with
"functions that differ only in their return type cannot be overloaded".

Use the new [[clang::sycl_*]] attributes for these definitions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bc1a551 changed NVPTX to print scalar kernel params as .b<N>
instead
of .u<N>. Update the two Intel SYCL local-accessor NVPTX tests to expect
.b32, matching the upstream test updates in that commit:

- llvm/test/CodeGen/NVPTX/local-accessor-to-shared-memory-triple.ll
-
llvm/test/CodeGen/NVPTX/local-accessor-to-shared-memory-valid-triple.ll

Test-only change; no functional impact.

AI-assisted: analysis and fix produced with Claude Code.

Jira: CMPLRLLVM-78661

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2d626aac4f746734733e9c6ea52cafc79b985824)
@iclsrc iclsrc added the disable-lint Skip linter check step and proceed with build jobs label Oct 17, 2026
The merge left a second add_distinct_clang_unittest(OffloadArchTests)
inside the Windows-only block, causing a CMake CMP0002 error. Append
AMDGPUArchByHIP.cpp to OffloadArchTestSources instead, matching xmain
and upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jsji jsji closed this Oct 19, 2026
@jsji jsji reopened this Oct 19, 2026
@jsji

jsji commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

This is ready for review.

@intel/dpcpp-nativecpu-reviewers (1 commit)

Conflict resolution fix related to AMDGPU test only, cherry-picked from xmain resolutions.

@jsji

jsji commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@bratpiorka bratpiorka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NativeCPU LGTM

@jsji

jsji commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers This is ready for merge, please help to issue "/merge". Thanks.

@sarnex

sarnex commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

/merge

@sarnex

sarnex commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@jsji Might want to try manually triggering the bot

@bb-sycl

bb-sycl commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Tue 20 Oct 2026 02:39:48 PM UTC --- Start to merge the commit into sycl branch. It will take several minutes.

@jsji

jsji commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@jsji Might want to try manually triggering the bot

Done. Sent email for tool team to have a look at why it is not triggered correctly .

@bb-sycl

bb-sycl commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Tue 20 Oct 2026 02:54:24 PM UTC --- Merge the branch in this PR to base automatically. Will close the PR later.

@bb-sycl
bb-sycl merged commit fdbfa79 into sycl Oct 20, 2026
75 of 90 checks passed
@bb-sycl
bb-sycl deleted the llvmspirv_pulldown branch October 20, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable-lint Skip linter check step and proceed with build jobs

Projects

None yet

Development

Successfully merging this pull request may close these issues.