[cfe-dev] [RFC][OpenCL] Rename OpenCL opaque types in LLVM IR from opencl.* to __opencl_*

Liu, Yaxun (Sam) via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 20 10:49:00 PDT 2016


Currently OpenCL opaque types have name opencl.* in LLVM IR, which causes difficulty for library developers who need to implement the concrete types corresponding to the opaque types.

For example, read_only image2d_t type is translated to opencl.image2d_ro_t addrspace(1)* in LLVM IR. Ideally, a library developer would implement a concreate struct type with name opencl.image2d_ro_t and access its members. However, due to the '.', 'opencl.image2d_ro_t' is not a valid identifier in OpenCL C language, library developers cannot use it as the name of the concrete struct type for image2d_t. Bitcasts have to be introduced, which causes extra efforts in backends.

Due to this reason, we would like to propose renaming OpenCL opaque types in LLVM IR from opencl.* to __opencl_*.

This change will make the IR deviate from SPIR spec. However, considering there is simple rule to map this new name to SPIR defined name, and LLVM IR currently generated by Clang has already been deviated from SPIR spec, a SPIR consumer should be able to accommodate this change if it is able to accommodate existing deviations.

Your feedbacks are welcome. Thanks.

Sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 12172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160720/237fc398/attachment.bin>


More information about the cfe-dev mailing list