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

Anastasia Stulova via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 25 08:41:13 PDT 2016


Sounds good to me!

Thanks,

Anastasia

From: Liu, Yaxun (Sam) [mailto:Yaxun.Liu at amd.com]
Sent: 20 July 2016 18:49
To: cfe-dev (cfe-dev at lists.llvm.org)
Cc: Anastasia Stulova; Sumner, Brian; Bader, Alexey (alexey.bader at intel.com); Pan, Xiuli
Subject: [RFC][OpenCL] Rename OpenCL opaque types in LLVM IR from opencl.* to __opencl_*

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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160725/ecd1f069/attachment.html>


More information about the cfe-dev mailing list