KhronosGroup / KhronosGroup/SPIR

Improper read_image built-ins attribute.

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.