[cfe-dev] [OpenCL] Representing kernel attributes by LLVM target-dependent attribute-value pairs instead of metadata

Mekhanoshin, Stanislav via cfe-dev cfe-dev at lists.llvm.org
Mon May 9 13:13:32 PDT 2016


It will make our life much easier I would say.

Stas

From: Liu, Yaxun (Sam)
Sent: Monday, May 09, 2016 1:05 PM
To: cfe-dev (cfe-dev at lists.llvm.org) <cfe-dev at lists.llvm.org>; 'anastasia.stulova at arm.com' <anastasia.stulova at arm.com>; Pan, Xiuli <xiuli.pan at intel.com>; Bader, Alexey (alexey.bader at intel.com) <alexey.bader at intel.com>
Cc: Stellard, Thomas <Tom.Stellard at amd.com>; Sumner, Brian <Brian.Sumner at amd.com>; Mekhanoshin, Stanislav <Stanislav.Mekhanoshin at amd.com>
Subject: [OpenCL] Representing kernel attributes by LLVM target-dependent attribute-value pairs instead of metadata

Hi,

When SPIR 1.2/2.0 spec was developed, there was no target-dependent attribute-value pair in LLVM. As such, kernel attributes were represented as metadata.

This caused lots of inconvenience since these metadata are difficult to manipulate/change when kernel functions went through transformations in backends.

Now LLVM supports target-dependent attribute-value pair, I am wondering whether it is time to use that to represent kernel attributes.

e.g. something like (just to give an idea, not exact llvm IR)

kernel void foo(global int*a, sampler_t s); #1
#1 = {
reqd_work_group_size="1 1 1",
kernel_arg_type="int *, sampler_t",
...
}

basically we keep the info conveyed by the original metadata but attach them to the kernel function as attribute/value pair. This will make these attributes much easier to manipulate/change.

Any feedbacks? Thanks.

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160509/e3732559/attachment.html>


More information about the cfe-dev mailing list