KhronosGroup / KhronosGroup/SPIR
Improper read_image built-ins attribute.
- Dominant language
- C++
- Stars
- 183
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
A bunch of read_imageXX bult-ins declared in opencl_1.2.h and opencl.h has __attribute__((const)) (translated to readnone in LLVM IR) which instructs the compiler what these functions do not access memory which is wrong by definition. Proper attribute is __attribute__((pure)) that means the functions do not modify memory. It seem both (SPIR 1.2 and SPIR-V) generators have this bug.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the read_imageXX declarations in opencl_1.2.h and opencl.h, then inspect the SPIR 1.2 and SPIR-V generators that produce them. Verify how __attribute__((const)) is translated to LLVM IR and update the declarations so the generated functions use the intended memory-effect attribute. Done means both generators produce correct attributes for these built-ins.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100