-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL] Fix handling of structs with trailing padding in SpecConstants pass #10211
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] Fix handling of structs with trailing padding in SpecConstants pass #10211
Conversation
This patch fixes a regression accidentally introduced in intel#9874 (presumably because we didn't have the right test). SYCL-CTS produces an LLVM IR pattern, where spec constant initializer contains less elements than there are in a spec constant type, because some of those elements are implicitly-created paddings. The patch updates the pass to handle this situation. Resolves intel#10129
@intel/sycl-language-enabling-triage: FYI |
Hi @maksimsab Can you please take a look at this PR? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test sycl/test-e2e/SpecConstants/2020/non-packed-struct.cpp LGTM. compiler part is out of my expertise
@intel/dpcpp-tools-reviewers, @maksimsab, could you please take a look? |
Looking into it. |
@AlexeySachkov |
Good point, let me add a test like this to see if there are more problems related to paddings |
@maksimsab, we indeed don't support the case when padding is embedded into a structure and it causes crash on assertion. However, I would like to proceed with the current PR as-is, if possible, because it unblocks build of SYCL-CTS specialization constant tests. Apparently, the new case you have suggested is not tested by CTS and I think that it therefore should be ok to address it in a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch fixes a regression accidentally introduced in #9874 (presumably because we didn't have the right test).
SYCL-CTS produces an LLVM IR pattern, where spec constant initializer contains less elements than there are in a spec constant type, because some of those elements are implicitly-created paddings. The patch updates the pass to handle this situation.
Note: this PR only covers a case when padding is inserted at the end of a struct.
Resolves #10129