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

Joshua Cranmer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 16 08:14:42 PDT 2022


jcranmer-intel added a comment.

In D127579#3588607 <https://reviews.llvm.org/D127579#3588607>, @iliya-diyachkov wrote:

> I think the return type information can be added in the next version of the patch, however it should be attached to function declarations (not definitions as it's done now), right? Do you think, declarations also require information about argument types?

Function declarations are more useful to get information than function definitions. A lot of the failures I'm currently seeing in my side of things appear to be due to not getting pointer types right when calling OpenCL/SYCL builtins causing interesting things to happen later on.

There's another approach I've considered taking, which is rather than using a metadata-based approach, emitting `elementtype` for any pointer-valued arguments [it doesn't solve return values, though]. This does require more changes to LLVM to let such attributes work on non-intrinsic functions, but it may end up working smoother than trying to reparse C types as LLVM types.


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