Skip to content

[SYCL][Doc] Adjust design for compile-time properties through add_ir_annotations_member #5884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

steffenlarsen
Copy link
Contributor

During implementation of the attribute and translation of annotations on fields, the design was conflicting with existing features. This commit makes the following design changes:

  • Change the llvm.ptr.annotation intrinsic call produced by [[__sycl_detail__::add_ir_annotations_member()]] to use a pointer to a constant global variable instead of metadata. This is done to adhere to the signature of the intrinsic.
  • Change the representation consumed by the translator from a new SPIR-V builtin to an extended version of existing decoration parsing using llvm.ptr.annotation.

Implementation of these are in review #5879 and KhronosGroup/SPIRV-LLVM-Translator#1446

…annotations_member

During implementation of the attribute and translation of annotations
on fields, the design was conflicting with existing features. This
commit makes the following design changes:

 * Change the `llvm.ptr.annotation` intrinsic call produced by
   `[[__sycl_detail__::add_ir_annotations_member()]]` to use a pointer
   to a constant global variable instead of metadata. This is done to
   adhere to the signature of the intrinsic.
 * Change the representation consumed by the translator from a new
   SPIR-V builtin to an extended version of existing decoration parsing
   using `llvm.ptr.annotation`.

Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
@steffenlarsen steffenlarsen requested a review from gmlueck March 24, 2022 16:24
Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
gmlueck
gmlueck previously approved these changes Mar 25, 2022
@steffenlarsen
Copy link
Contributor Author

The SPIR-V translator changes have been merged and the FE (#5879) has one approval. As such I think we can move this out of draft.

@steffenlarsen steffenlarsen marked this pull request as ready for review March 31, 2022 15:53
@steffenlarsen steffenlarsen requested a review from a team as a code owner March 31, 2022 15:53
* The third parameter is the name of the source file (as with any call to this
intrinsic).
* The fourth parameter is the line number (as with any call to this intrinsic).
* The fifth parameter is a pointer to a constant global variable. The type of
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it allowed adding parameters to the @llvm.ptr.annotation intrinsic? In the LangRef only 4 parameters are described.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is curious. According to the intrinsic definition in Intrinsics.td it has 5 parameters, the last being another i8 *. It does not seem to be a recent change so I think maybe someone forgot to update the LangRef?

@bader bader requested a review from a user April 5, 2022 15:39
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@steffenlarsen steffenlarsen merged commit f6420c7 into intel:sycl May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants