llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Turn `indirectly-callable` property into `sycl_device` attribute

Open AlexeySachkov opened this issue 1 year ago • 0 comments

This PR is a part of virtual functions feature being designed in intel/llvm#10540. One aspects of the proposed language specification is to be able to mark functions as device functions using SYCL compile-time properties mechanism.

Compile-time properties are lowered into [[__sycl_detail__::add_ir_attribute_function()]] attribute and this patch introduces extra processing for the attribute: property names passed to the attribute are analyzed so we can generate other attributes based on those strings.

The only example of such property/attribute pair is indirectly-callable string that indicates that a function with such property should be treated as if it had sycl_device attribute attached to it and we do exactly that implicitly now.

Note that there were changes required to the attribute parsing logic: because we now access its argument way earlier than we used to, that logic had to be improved to be more robust and pass existing SemaSYCL/attr-add-ir-attributes.cpp test.

AlexeySachkov avatar May 17 '24 13:05 AlexeySachkov