Skip to content

[SYCL][Fusion] Adapt internalization to opaque pointers. #10882

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 10 commits into from
Aug 29, 2023

Conversation

jopperm
Copy link
Contributor

@jopperm jopperm commented Aug 18, 2023

Fixes sycl/test-e2e/KernelFusion/internalize_array_wrapper.cpp which was temporarily deactivated in #9828.

Switching to opaque pointers meant that accesses to the data structure in the testcase were no longer represented as one "deep" GEP, but rather a series of GEPs into the different nesting levels of the structure. Rather than bailing out, we now keep track of GEPs that index into an aggregate object, and exclude their users from the modulo-LocalSize rewriting (the pointer types still have to be changed to the desired target address space, though).

In addition, perform -simplifycfg before internalization in order to get rid of unreachable code which, in this particular case, contained Phi nodes on the candidate accessor.

@jopperm jopperm requested a review from victor-eds as a code owner August 18, 2023 15:01
@jopperm jopperm self-assigned this Aug 18, 2023
@jopperm jopperm marked this pull request as draft August 18, 2023 15:37
@jopperm jopperm force-pushed the fix-kf-internalization branch from 46930c3 to 6c5e9e5 Compare August 21, 2023 16:32
@jopperm jopperm changed the title [SYCL][Fusion] Fix array internalization test with opaque pointers. [SYCL][Fusion] Adapt internalization to opaque pointers. Aug 21, 2023
@jopperm jopperm force-pushed the fix-kf-internalization branch from 6c5e9e5 to 498b169 Compare August 21, 2023 16:48
@jopperm jopperm marked this pull request as ready for review August 21, 2023 16:51
Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

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

Do we need to add a LIT test checking that we do not promote a pointer into an aggregate?

Copy link
Contributor

@victor-eds victor-eds left a comment

Choose a reason for hiding this comment

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

Looks good. Can you add some lit tests to sycl-fusion/test/internalization/ testing new cases?

@jopperm
Copy link
Contributor Author

jopperm commented Aug 24, 2023

CI failure looks unrelated. I'm still missing a testcase for aborting propagation into function calls, though.

@jopperm
Copy link
Contributor Author

jopperm commented Aug 25, 2023

I've added a lit test for stopping the promotion of calls in InAggregate mode, and changed the corresponding error message to an NYI (rather than "it's unsafe") -- I think it could be supported, but we'd need to change the implementation to propagate the InAggregate flag on a per-argument-basis, which I'd argue is out of scope for this PR.

@jopperm
Copy link
Contributor Author

jopperm commented Aug 25, 2023

Failure on CUDA is caused by a test added by this PR; investigating.

@bader bader merged commit 16b3d9e into intel:sycl Aug 29, 2023
@jopperm jopperm deleted the fix-kf-internalization branch August 29, 2023 15:21
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.

5 participants