Skip to content

[SYCL] Enable compiler rt builtin for SPIRV device code#21724

Draft
jinge90 wants to merge 27 commits intointel:syclfrom
jinge90:enable_compiler_rt_builtin_spirv
Draft

[SYCL] Enable compiler rt builtin for SPIRV device code#21724
jinge90 wants to merge 27 commits intointel:syclfrom
jinge90:enable_compiler_rt_builtin_spirv

Conversation

@jinge90
Copy link
Copy Markdown
Contributor

@jinge90 jinge90 commented Apr 10, 2026

This PR enables compiler-rt builtin library for SYCL device code. Currently, we only need __mulsc3/dc3 and __divsc3/dc3 for complex multiplication/division.

Signed-off-by: jinge90 <ge.jin@intel.com>
Signed-off-by: jinge90 <ge.jin@intel.com>
@jinge90 jinge90 requested review from a team and bader as code owners April 10, 2026 06:22
@jinge90 jinge90 requested a review from cperkinsintel April 10, 2026 06:22
@jinge90 jinge90 marked this pull request as draft April 10, 2026 06:22
@jinge90
Copy link
Copy Markdown
Contributor Author

jinge90 commented Apr 10, 2026

Hi, @bader
We begin to enable compiler-rt builtin library for SYCL device code, this PR is the first one.
For compiler-rt builtin library, we only need 4 functions (__mulsc3, __muldc3, __divsc3, __divdc3) on Linux platform only.
We ported corresponding compiler-rt tests to SYCL e2e in #21622. This PR is still in progress, it only builds the libclang_rt.builtins.bc for device code, more work is needed to support linking it in compiler driver. I will ping you to review when all parts are finished.
Thanks very much.

jinge90 added 2 commits April 10, 2026 14:43
Signed-off-by: jinge90 <ge.jin@intel.com>
Signed-off-by: jinge90 <ge.jin@intel.com>
@bader
Copy link
Copy Markdown
Contributor

bader commented Apr 10, 2026

Hi, @bader We begin to enable compiler-rt builtin library for SYCL device code, this PR is the first one. For compiler-rt builtin library, we only need 4 functions (__mulsc3, __muldc3, __divsc3, __divdc3) on Linux platform only. We ported corresponding compiler-rt tests to SYCL e2e in #21622. This PR is still in progress, it only builds the libclang_rt.builtins.bc for device code, more work is needed to support linking it in compiler driver. I will ping you to review when all parts are finished. Thanks very much.

Hi @jinge90. Thanks for tagging me. I suggest we move this PR to https://github.com/llvm/llvm-project/ to review these changes with compiler-rt code owners.

A couple of high-level notes/questions:

  1. I think we shouldn't switch from C to SYCL language compilation mode when we build for SPIR-V target. Have you tried using the C language mode?
  2. Do you have any estimation how hard it would be to enable the generic sources list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants