Skip to content

[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

Merged
merged 11 commits into from
Dec 21, 2023

Conversation

smanna12
Copy link
Contributor

@smanna12 smanna12 commented Dec 14, 2023

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.

…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>
@smanna12 smanna12 requested a review from a team as a code owner December 14, 2023 14:26
@smanna12 smanna12 changed the title [SYCL][FPGA] Ignore duplicate memory attributes applied to declaratio… [SYCL][FPGA] Ignore duplicate memory attributes applied to declarations with different arguments Dec 14, 2023
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>
@@ -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>()) {
Copy link
Contributor

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

Copy link
Contributor Author

@smanna12 smanna12 Dec 18, 2023

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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>
Copy link
Contributor

github-actions bot commented Dec 19, 2023

:white_check_mark: With the latest revision this PR passed the C/C++ code formatter.

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12
Copy link
Contributor Author

Thank you @elizabethandrews and @premanandrao for reviews!

@intel/llvm-gatekeepers, This PR is ready to be merged. Thank you

@againull againull merged commit 803fa48 into intel:sycl Dec 21, 2023
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.

4 participants