KhronosGroup / SPIR

Other
177 stars 49 forks source link

Improper read_image built-ins attribute. #40

Open AndreyE opened 8 years ago

AndreyE commented 8 years ago

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.