-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Add support for [[intel::reqd_sub_group_… #2137
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
…size()]] This patch adds new spelling of IntelReqdSubGroupSize attribute and generates a diagnostic which will tell that previous spelling of the attribute is deprecated. Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
@@ -10969,6 +10969,9 @@ def err_ivdep_declrefexpr_arg : Error< | |||
def warn_ivdep_redundant : Warning <"ignoring redundant Intel FPGA loop " | |||
"attribute 'ivdep': safelen %select{INF|%1}0 >= safelen %select{INF|%3}2">, | |||
InGroup<IgnoredAttributes>; | |||
def warn_attribute_spelling_deprecated : Warning< | |||
"previous spelling of attribute %0 is deprecated">, |
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.
User's aren't particularly knowledgeable about the fact that the same attribute can be spelled in 2 different ways. They tend to treat them as different attributes with similar/same behavior.
Additionally, we likely want to suggest
This should probably be:
"attribute %0 is deprecated
Then a note of: <note_function_suggestion > "did you mean %1?"
Additionally, See if you can find if there is a good note that we can use to suggest
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.
User's aren't particularly knowledgeable about the fact that the same attribute can be spelled in 2 different ways. They tend to treat them as different attributes with similar/same behavior.
Additionally, we likely want to suggest
This should probably be:
"attribute %0 is deprecated
Then a note of: <note_function_suggestion > "did you mean %1?"Additionally, See if you can find if there is a good note that we can use to suggest
Thanks @erichkeane for the suggestion. I will look at this and update the diagnostic.
Signed-off-by: Soumi Manna <[email protected]>
@@ -10969,6 +10969,9 @@ def err_ivdep_declrefexpr_arg : Error< | |||
def warn_ivdep_redundant : Warning <"ignoring redundant Intel FPGA loop " | |||
"attribute 'ivdep': safelen %select{INF|%1}0 >= safelen %select{INF|%3}2">, | |||
InGroup<IgnoredAttributes>; | |||
def warn_attribute_spelling_deprecated : Warning< | |||
"attribute %0 is deprecated, did you mean to use 'reqd_sub_group_size' instead?">, |
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 had suggested making this a warning + note (using something like note_function_suggestion) as it seems to fit how diagnostics work better, and still have a preference for it. But @elizabethandrews @Fznamznon and @premanandrao can make the final call here.
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 personally prefer adding a note. However I see instances of 'did you mean' in error/warning message itself in DiagnosticsSemaKinds.td. @erichkeane what does clang community recommend? If they recommend using a separate note, @smanna12 would you mind adding a note? There are examples in DiagnosticsSemaKinds.td
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 suspect we are consistently inconsistent :) Clang typically doesn't have its warnings be prescriptive, but I can see that we do in a bunch of cases. I'm not sure we have official guidance.
That said, if we leave it alone, i think the suggested replacement needs to be a replacement as well. Finally, don't we mean:
'did you mean to use 'intel::reqd_sub_group_size' instead?"
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.
Thanks @elizabethandrews and @erichkeane for the comments.
However I see instances of 'did you mean' in error/warning message itself in DiagnosticsSemaKinds.td.
Yes, i saw several examples that used and so added in the warning message.
I have added warning+ note and updated all tests with it.
Signed-off-by: Soumi Manna <[email protected]>
InGroup<DeprecatedAttributes>; | ||
def note_spelling_suggestion : Note< | ||
"did you mean to use 'intel::reqd_sub_group_size' instead?">; |
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.
Make intel::reqd_sub_group_size a %0 instead, then fill it in with your Diag call.
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 was actually surprised a general 'did you mean' like this one did not exist already.
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.
@elizabethandrews : the only one I found was note_function_suggestion, which is textually identical to what I'd like, but is function-specific. I'm tempted to update the name in the upstream to make it work for anything...
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.
Make intel::reqd_sub_group_size a %0 instead, then fill it in with your Diag call.
Done.
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
@@ -5,7 +5,9 @@ | |||
template <int SIZE> | |||
class KernelFunctor { | |||
public: |
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 feels weird to me that existing tests all throw warnings now. I am not sure what is usually done when spellings are changed though. Personally I would just prefer updating these tests to use the new spelling (except where this functionality is actually being checked). @erichkeane thoughts?
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 could go either way. There aren't that many tests to just 'fix' the spelling of here, so I'd probably suggest just fixing all the spellings instead.
If this was more widespread (that is, the tests were a pain to change), or a situation where there was a difference in the implementation, I'd consider just using the -Wno flag in the tests. In this case, I think just changing the spelling in the tests is better than adding the warning/note to ALL of them.
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.
That said, probably leave at least 1 to validate the deprecated warning :)
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.
Yea. That's what I meant by 'except where this functionality is actually being checked' :)
@smanna12 sorry but can you make this change? I think it's just cleaner this way.
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.
Yea. That's what I meant by 'except where this functionality is actually being checked' :)
@smanna12 sorry but can you make this change? I think it's just cleaner this way.
Sure. I will do this.
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 you still need to leave ONE example (perhaps add a new example) to validate the new warning/note.
Done
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.
yes, right. By mistake, I changed all spellings.
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.
Sorry for the multiple submission.
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
Signed-off-by: Soumi Manna <[email protected]>
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.
LGTM
Thanks for the review. |
Signed-off-by: Soumi Manna <[email protected]>
7c4204e
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.
@smanna12 thanks for clarification and sharing plans! The patch is LGTM with an exception of one unresolved comment from @erichkeane
…size()]]
This patch adds new spelling of IntelReqdSubGroupSize attribute
and generates a diagnostic which will tell that previous spelling
of the attribute is deprecated.
Signed-off-by: Soumi Manna [email protected]