[all-commits] [llvm/llvm-project] 6b80b2: [clang-sycl-linker] Add per-kernel device code spl...

Yury Plyakhin via All-commits all-commits at lists.llvm.org
Tue May 5 11:23:14 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b80b27b9c99dd22ceddd9ee5226b63f178e7507
      https://github.com/llvm/llvm-project/commit/6b80b27b9c99dd22ceddd9ee5226b63f178e7507
  Author: Yury Plyakhin <yury.plyakhin at intel.com>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    A clang/test/Driver/Inputs/SYCL/two-kernels.ll
    M clang/test/Driver/clang-sycl-linker-test.cpp
    M clang/tools/clang-sycl-linker/CMakeLists.txt
    M clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
    M clang/tools/clang-sycl-linker/SYCLLinkOpts.td
    M llvm/include/llvm/Transforms/Utils/SplitModuleByCategory.h
    M llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
    M llvm/tools/llvm-split/llvm-split.cpp

  Log Message:
  -----------
  [clang-sycl-linker] Add per-kernel device code splitting (#195362)

Introduce a --sycl-module-split-mode option for clang-sycl-linker that
selects how the fully linked device module is split into device images:
  - none (default): one device image containing all kernels
- kernel: one device image per kernel function, built by taking the
transitive closure of each kernel's dependencies

The split is implemented by delegating to
llvm::splitModuleTransitiveFromEntryPoints, providing a categorizer that
assigns each kernel definition a unique integer id.

Symbol collection now happens during splitting while the Module is still
in memory, avoiding a round-trip through disk to re-read the bitcode for
symbol extraction.

As part of this change, the splitModuleTransitiveFromEntryPoints API is
updated to accept an Error-returning callback and propagate errors from
it, replacing the previous void callback signature. The existing caller
in llvm-split is updated accordingly.

Additionally, linkDeviceCode now returns the linked Module alongside the
bitcode file path, so the splitter operates on the in-memory module
directly rather than re-reading it from disk.

Additional split modes (per-translation-unit, optional-feature grouping)
and specialization-constant handling will be introduced in
follow-up changes.

Co-Authored-By: Claude



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list