Skip to content
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

[SYCL] Make PropertySetRegistry being owning it's content #12582

Merged
merged 4 commits into from
Mar 8, 2024

Conversation

maksimsab
Copy link
Contributor

@maksimsab maksimsab commented Feb 1, 2024

Before this patch PropertySetRegistry used StringRefs that point at external data that was supposed to outlive the instance of PropertySetRegistry. It wasn't obvious and it might lead to memory bugs. This patch makes PropertySetRegistry owning it's content as containers usually do.

Also documentation is aligned with doxygen BKSM.

Before this patch PropertySetRegistry used StringRefs
that point at external data that was supposed to outlive the instance of
PropertySetRegistry. It wasn't obvious and it might lead to memory bugs.
This patch makes PropertySetRegistry owning it's content as containers
usually do.

Also the previous implementation had a property that a content is
being printed in the order it was added. This patch removes this
property. However, the patch brings a sorted order in write() method
in order to make testing as easy as it was. Accordingly, all affected tests
were aligned to the sorted order.

Also documentation is aligned with doxygen BKSM.
@maksimsab maksimsab requested a review from a team as a code owner February 1, 2024 17:06
@maksimsab maksimsab changed the title [SYCL] Make PropertySetRegistry owning it's content [SYCL] Make PropertySetRegistry being owning it's content Feb 1, 2024
@maksimsab
Copy link
Contributor Author

From test's failures it looks like we can't simply change the order of spec const's IDs in metadata.

Copy link
Contributor

@againull againull left a comment

Choose a reason for hiding this comment

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

sycl/test/* changes LGTM

Fix failing test in sycl/test/basic_tests.
Get order of elements preserved as it was initially.
Align tests correspondingly.
@maksimsab
Copy link
Contributor Author

Status update:
Initially I made a change that removes the order of elements in PropertyRegistry. Later on I found out that the current SpecConsts pass rely on that property and this is difficult to adopt the pass to the missing order of elements or sorted order of elements.
I decided to return this property back. This PR still has a fix of data owning that removes UB with use of freed data.

@maksimsab
Copy link
Contributor Author

@asudarsa Could you please review this when you have free time?

@asudarsa
Copy link
Contributor

Hi @maksimsab

I think such changes to core LLVM files should be directly made upstream, I would advise to split this into two PR. One upstream PR to change code inside PropertySetIO files and once that change is done, you can make the changes to sycl-post-link on top of it.

Thanks

@maksimsab
Copy link
Contributor Author

Hi @asudarsa

PropertySetIO doesn't belong to llvm-project.

@asudarsa
Copy link
Contributor

Hi @asudarsa

PropertySetIO doesn't belong to llvm-project.

Oh. You are right. Sorry a miss on my part. One more thing to upstream then

Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

lgtm

@maarquitos14
Copy link
Contributor

maarquitos14 commented Mar 8, 2024

The pre-commit failure is known and has been reported already in #12791. I don't think it's related to these changes.

@steffenlarsen steffenlarsen merged commit 43201db into intel:sycl Mar 8, 2024
12 checks passed
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.

6 participants