This patch uses function metadata to represent reqd_work_group_size, work_group_size_hint and vector_type_hint kernel attributes and kernel argument info.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looking good generally, I am just not sure about mixing two different representations.
If we choose only one form of representation, would you suggest to use function metadata or function attribute?
I am still not sure if this is the intended use of target-dependent attributes to be honest. So I would prefer metadata representation.
Also if we use metadata could we avoid parsing values from strings potentially in contrast to attributes that represent all values as strings?
Related to your earlier comments about inflexibility of metadata, would it be possible to extend MDNode to be able to insert new operands?
OK due to the controversy of target-dependent function attributes, let's concur to use function metadata for all the kernel attributes, and do not convert everything to string in the metadata.
Related to your earlier comments about inflexibility of metadata, would it be possible to extend MDNode to be able to insert new operands?
I will see how difficult is that.
LGTM.
test/CodeGenOpenCL/kernel-attributes.cl | ||
---|---|---|
9 ↗ | (On Diff #60545) | AFAIK, this named metadata node were also useful for kernel functions traversal. |
test/CodeGenOpenCL/kernel-attributes.cl | ||
---|---|---|
9 ↗ | (On Diff #60545) | I think it could be used for that purpose, since kernel functions and only kernel functions have this function attribute. |