-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL][FPGA] Ignore duplicate memory attributes applied to declarations with different arguments #12175
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
…ns with different arguments This patch refactors [[intel::fpga_memory]] to handle duplicate vs conflicting attribute values properly and aligns with other upstream attributes. 1. Adds diagnostic if there's a duplicate attribute with different arguments already applied to the declaration. 2. No diagnostic is emitted if the arguments match. 3. Drops the duplicate attribute. Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
clang/lib/Sema/SemaDeclAttr.cpp
Outdated
@@ -7548,6 +7546,17 @@ static void handleSYCLIntelMemoryAttr(Sema &S, Decl *D, | |||
if (MA->isImplicit()) | |||
D->dropAttr<SYCLIntelMemoryAttr>(); | |||
|
|||
// Check to see if there's a duplicate attribute with different values | |||
// already applied to the declaration. | |||
if (const auto *MA = D->getAttr<SYCLIntelMemoryAttr>()) { |
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.
Is there a reason we're making these changes? I mean I don't see the harm but did we have a request to diagnose this? Just curious about what prompted this change.
This check can also be combined with check above on L7545
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.
Is there a reason we're making these changes? I mean I don't see the harm but did we have a request to diagnose this? Just curious about what prompted this change.
@elizabethandrews, this is due to your comment #11385, so i thought to improve the existing duplicate memory attribute diagnostics as well.
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.
This check can also be combined with check above on L7545
Sure,
i will combine 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.
This check can also be combined with check above on L7545
Done. Thanks for catching!
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
|
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Thank you @elizabethandrews and @premanandrao for reviews! @intel/llvm-gatekeepers, This PR is ready to be merged. Thank you |
This patch refactors [[intel::fpga_memory]] to handle duplicate vs conflicting attribute values properly and aligns with other upstream attributes.
1. Adds diagnostic if there's a duplicate attribute with different
arguments already applied to the declaration.
2. No diagnostic is emitted if the arguments match.
3. Drops the duplicate attribute.