KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator

Translator doesn't handle LLVM integer types.

Open
#481 9 comments 0 reactions 0 assignees View on GitHub
agenda bug
Dominant language
LLVM
Stars
625
Forks
279
Avg merge
3d 5h
Merged PRs (30d)
34

Description

https://godbolt.org/z/p3D7TX - legit OpenCL code, which translator can't convert to SPIR-V due to `i3` type.
The translator with the assertions gives me:
```
InvalidBitWidth: Invalid bit width in input: 3
```

Proper LLVM back-end should be able to handle such types...

Is there an easy way to avoid such types in LLVM IR by configuring SPIR target in clang?

Contributor guide

Open the contributing guide

Research direction

Start with the linked Godbolt reproduction and confirm that the OpenCL input produces an i3 LLVM type and the reported InvalidBitWidth error. No source file or test is named; trace the translator's LLVM integer-type handling, and consider the issue complete when the reproduction is handled or a confirmed SPIR target configuration workaround is documented.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.