Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIRV] Lower LLVM IR Type of array of zero length to spirv type of array of length 1 #15663

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

lbushi25
Copy link
Contributor

Cherry-pick of KhronosGroup/SPIRV-LLVM-Translator#2743.

The LLVM-IR type of zero-length array does not seem to have a mapping into SPIR-V type, rather it outputs an error since the obvious choice of zero-length array is not valid in SPIR-V. This, for example, prohibits us from using unbounded arrays in SYCL device kernels because they are typically represented in LLVM-IR through zero-length arrays. This PR introduces a workaround to this by lowering a zero-length array in LLVM-IR to a 1-length array in SPIR-V.

@lbushi25 lbushi25 requested a review from a team as a code owner October 10, 2024 19:25
@AlexeySachkov AlexeySachkov merged commit 7997c3c into intel:sycl Oct 11, 2024
12 checks passed
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