[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 08:10:32 PDT 2022


bader added a comment.

In D127579#3585516 <https://reviews.llvm.org/D127579#3585516>, @beanz wrote:

> @nikic the most important thing you need to know about SPIR-V is that it is a virtual ISA based on LLVM IR. The ISA itself encodes types for pointers just like LLVM IR would.

And in addition to that ISA defines types, which are not natively supported by LLVM IR e.g. image. To represent those types clang in OpenCL language mode emits a pointer to an opaque structure with special name like opencl.<ISA_type_name> (e.g. opencl.image2d_t). All ISA types, which are defined that way look the same with type-less pointers.
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/OpenCLImageTypes.def


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127579/new/

https://reviews.llvm.org/D127579



More information about the cfe-commits mailing list