Skip to content

[SYCL][ESIMD] Lower global volatile stores to vstores #9088

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 5 commits into from
Apr 19, 2023

Conversation

sarnex
Copy link
Contributor

@sarnex sarnex commented Apr 17, 2023

According to the VC team, all stores to volatile globals need to be vstores for correctness. Sometimes clang implicitly inserts stores, and if this happens, we need to lower to vstores.

With that, we no longer need the commit() function, so remove it and update related doc. It never made it onto a compiler release, so we should be able to remove it with no deprecation.

@sarnex sarnex temporarily deployed to aws April 17, 2023 21:26 — with GitHub Actions Inactive
@sarnex sarnex temporarily deployed to aws April 17, 2023 23:01 — with GitHub Actions Inactive
@sarnex sarnex temporarily deployed to aws April 18, 2023 14:04 — with GitHub Actions Inactive
According to the VC team, all stores to volatile globals need to be vstores for correctness.
Sometimes clang implicitly inserts stores, and if this happens, we need to lower to vstores.

With that, we no longer need the commit() function, so remove it and update related doc.
It never made it onto a compiler release, so we should be able to remove it with no deprecation.

Signed-off-by: Sarnie, Nick <[email protected]>
@sarnex sarnex temporarily deployed to aws April 18, 2023 15:17 — with GitHub Actions Inactive
@sarnex sarnex temporarily deployed to aws April 18, 2023 16:14 — with GitHub Actions Inactive
@sarnex sarnex marked this pull request as ready for review April 18, 2023 17:06
@sarnex sarnex requested a review from a team as a code owner April 18, 2023 17:06
sarnex added 2 commits April 18, 2023 13:49
Signed-off-by: Sarnie, Nick <[email protected]>
Copy link
Contributor

@v-klochkov v-klochkov left a comment

Choose a reason for hiding this comment

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

@sarnex - thank you for this fix.
I have couple of comments, of is minor, and another is major concern.

Signed-off-by: Sarnie, Nick <[email protected]>
// of the simd object opertations, but in some cases clang can implicitly
// insert stores, such as after a write in inline assembly. To handle that
// case, lower any stores of genx_volatiles into vstores.
void lowerGlobalStores(Module &M, const SmallPtrSet<Type *, 4> &GVTS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can pass SmallPtrSetImpl<Type *> to not carry 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The GVTS variable is created and used elsewhere and already has type SmallPtrSet<Type *, 4>, and I don't think we are supposed to directly use Impl types, so I would prefer to leave this one as-is if that's okay.

Copy link
Contributor

Choose a reason for hiding this comment

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

Impl types are a common pattern in LLVM to pass the ADT as parameter to the function.
Please refer to the Note section on the bottom of this chapter in LLVM Programmer's Manual.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh i didnt know of this use case, ill make a follow up pr to address this feedback, thx

Signed-off-by: Sarnie, Nick <[email protected]>
@sarnex sarnex temporarily deployed to aws April 18, 2023 23:13 — with GitHub Actions Inactive
@sarnex sarnex temporarily deployed to aws April 19, 2023 02:02 — with GitHub Actions Inactive
@v-klochkov v-klochkov merged commit 48abe38 into intel:sycl Apr 19, 2023
sarnex added a commit to sarnex/llvm that referenced this pull request Apr 19, 2023
AlexeySachkov pushed a commit that referenced this pull request Apr 19, 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.

3 participants