- 
                Notifications
    You must be signed in to change notification settings 
- Fork 794
[SYCL][clang] Implement merging of add_ir_attributes_* attributes #20419
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
base: sycl
Are you sure you want to change the base?
[SYCL][clang] Implement merging of add_ir_attributes_* attributes #20419
Conversation
This commit adds the implementation logic for merging __sycl_detail__::add_ir_attributes_* attributes, which will enable the ability to apply multiple of the same attribute to the same declaration/definition, as long as the values associated to the same names in the attributes do not conflict. This is needed for SYCL free function support as the way SYCL properties are applied are through macros expanding to __sycl_detail__::add_ir_attributes_* with a single name-value-pair. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
| [[__sycl_detail__::add_ir_attributes_function("Attr1", "Attr2", 1, true)]] | ||
| [[__sycl_detail__::add_ir_attributes_function("Attr1", "Attr2", 1, true)]] | ||
| [[__sycl_detail__::add_ir_attributes_function("Attr2", "Attr1", true, 1)]] | ||
| [[__sycl_detail__::add_ir_attributes_function("Attr1", "Attr2", 1, false)]] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should include invalid tests in AST checks. Unless you're checking the attribute does not get added in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the two tests have the same set of cases, but I don't necessarily disagree. Would you like me to remove the existing invalid cases as part of this PR or in a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it anything you added should be be modified in this PR. We usually do not have invalid tests in AST checks.
Does invalid tests already exist in this file (before you changes)? If so, those should probably be modified in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did already have invalid cases indeed. I have removed the new cases and remove the existing ones in #20492.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I messed something up when trying to remove only the invalid cases introduced here. Instead of trying to fix the cases that will get removed anyway, I would prefer we merge the aforementioned PR first, then I will merge these changes with it.
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
This commit adds the implementation logic for merging sycl_detail::add_ir_attributes_* attributes, which will enable the ability to apply multiple of the same attribute to the same declaration/definition, as long as the values associated to the same names in the attributes do not conflict.
This is needed for SYCL free function support as the way SYCL properties are applied are through macros expanding to
sycl_detail::add_ir_attributes_* with a single name-value-pair.