Skip to content

[SYCL] IVDep: Add support for struct members and pointers #1908

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 3 commits into from
Jun 17, 2020

Conversation

erichkeane
Copy link
Contributor

Struct members was missed in the initial implementation, we just need to
properly handle the MemberExpr when doing our SEMA (+ consider it in a
few other places).

Pointers should be allowed, since the arrays decay to pointer pretty
easily in the type system. The implementation is as simple as allowing
it in Sema, then making sure we pass the Decl to the GEP creation
function.

Struct members was missed in the initial implementation, we just need to
properly handle the MemberExpr when doing our SEMA (+ consider it in a
few other places).

Pointers should be allowed, since the arrays decay to pointer pretty
easily in the type system. The implementation is as simple as allowing
it in Sema, then making sure we pass the Decl to the GEP creation
function.
Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

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

Thanks Erich for the support.

Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

@MrSidims , could you please take a look?

@Fznamznon Fznamznon requested a review from MrSidims June 17, 2020 06:47
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

@bader bader merged commit 358ec04 into intel:sycl Jun 17, 2020
@AGindinson
Copy link
Contributor

AGindinson commented Jun 17, 2020

Nice one, thanks Erich!
Taking this further, is there a way to allow all operator[] implementers (like cl::sycl::accessor) into the attribute's arguments? Or am I missing something and it's already facilitated by the pointer-supporting code?

@erichkeane
Copy link
Contributor Author

Nice one, thanks Erich!
Taking this further, is there a way to allow all operator[] implementers (like cl::sycl::accessor) implementers into the attribute's arguments? Or am I missing something and it's already facilitated by the pointer-supporting code?

There isn't really. If an attribute isn't something that modifies the type, the source code itself has no way to get to the attribute. What you CAN do is make the attribute and the code both get the argument the same way, such as a single constant expression that they both reference.

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.

7 participants