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

Fix for spir-v translation to IR for OpPtrAccessChain #173

Merged

Conversation

coldav
Copy link
Collaborator

@coldav coldav commented Oct 23, 2023

Overview

Fix for spir-v translation to IR for OpPtrAccessChain

Reason for change

In some cases the indexes field for OpPtrAccessChain can be empty. The translation code currently assumes this not to be the case and checks for element decorations, resulting in a segmentation fault during SYCL CTS testing.

Description of change

This fixes the empty index case by not checking the decorations in this case. There are some issues with OpMemberDecorate, so testing of the path with additional arguments requiring decorations will not be tested here.

Also some previous clang-format issues have been resolved.

Additional lit tests have been added.

@coldav coldav force-pushed the colin/fix_spirv_op_ptr_access_chain branch from 6c8dc21 to 21c2580 Compare October 23, 2023 15:17
@frasercrmck
Copy link
Contributor

I think styling spir-v as SPIR-V in the commit message/description would be more correct

@coldav coldav force-pushed the colin/fix_spirv_op_ptr_access_chain branch 2 times, most recently from f3d75eb to 0e43df2 Compare October 23, 2023 17:01
@coldav coldav force-pushed the colin/fix_spirv_op_ptr_access_chain branch 3 times, most recently from 707e570 to 62f1714 Compare October 24, 2023 09:49
In some cases the indexes field for OpPtrAccessChain can be empty.
The translation code currently assumes this not to be the case and
checks for element decorations.

This fixes the empty index case by not checking the decorations in this
case. There are some issues with OpMemberDecorate, so testing of the
path with additional arguments requiring decorations will not be tested here.

Also some previous clang-format issues have been resolved.
@coldav coldav force-pushed the colin/fix_spirv_op_ptr_access_chain branch from 62f1714 to 55beb04 Compare October 24, 2023 10:28
Copy link
Contributor

@frasercrmck frasercrmck 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. It might be worth adding LIT tests for the other nodes with optional index lists that call checkMemberDecorations, but that could also come later.

@coldav coldav merged commit 06f4989 into uxlfoundation:main Oct 24, 2023
3 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.

4 participants