-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Fix ESIMD split detection in module properties computation #15527
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
Conversation
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
| // symbols are usually removed at backend lowering, but this is handled here | ||
| // for SPIR-V since SYCL compilation uses llvm-spirv, not the SPIR-V backend. | ||
| if (auto Triple = M->getTargetTriple().find("spir") != std::string::npos) | ||
| if (M->getTargetTriple().find("spir") != std::string::npos) |
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.
This is not related to this change but fixes an unused variable warning.
| void ModuleDesc::saveSplitInformationAsMetadata() { | ||
| // Add metadata to the module so we can identify what kind of SYCL/ESIMD split | ||
| // later. | ||
| auto *SplitMD = M->getOrInsertNamedMetadata(SYCL_ESIMD_SPLIT_MD_NAME); |
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.
A nit:
If we are planning to add more metadata like this in the future, may be it will help to add a helper function?
Not a blocker though
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.
I don't expect it to grow that much, the things we check in module properties is limited and doesn't grow that often. If it does blow up we can just move each MD to a function, sure, thanks.
|
|
||
| namespace module_split { | ||
|
|
||
| constexpr char SYCL_ESIMD_SPLIT_MD_NAME[] = "sycl-split-status"; |
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.
May be sycl-esimd-split-status?
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.
sure, will rename, 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.
LGTM. Minor unblocking nit. Thanks for working on this.
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
|
thanks for the review! |
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
We need to know if a module is an ESIMD split or not split at all to set some image properties.
Right now we compute if a module is ESIMD or not by looking at the functions in the module and checking they are all ESIMD, except for allowed exceptions.
A new exception was found related to using
assertin user code where there is a scalar SYCL function that correctly remains in the ESIMD split. The end result is we don't set the ESIMD property because we don't think this is the ESIMD split and do the wrong thing at runtime. Instead of just adding this new exception to the list, I reworked what I consider to be flaky logic (that I wrote originally, whoops) to figure out the splits.Just save metadata in the module of what kind of split it is before we try to compute module properties.
We already do something similar for the spec constant default split, and I moved that to a centralized place as part of this change.
The reason we don't just pass in the
ModuleDescobject as an argument is because we want to untie properties creation from thesycl-post-linktool so that it can be called in other places (which we will do for thinLTO).