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

[SYCL] Move devicelib req mask collection into a LLVM pass #3291

Merged
merged 2 commits into from
Mar 4, 2021

Conversation

jinge90
Copy link
Contributor

@jinge90 jinge90 commented Mar 3, 2021

Signed-off-by: gejin ge.jin@intel.com

Signed-off-by: gejin <ge.jin@intel.com>
@jinge90
Copy link
Contributor Author

jinge90 commented Mar 3, 2021

Fallback device library 'on-demand' loading mechanism requires offline analysis of user's input device image to find out all fallback device libraries (spv) needed in runtime and the offline analysis is done in sycl-post-link. Currently, the analysis implementation is in sycl-post-link.cpp which is not the best practice since sycl-post-link.cpp should only include the implementation itself. This PR aims to move the analysis into a LLVM module pass, the sycl-post-link.cpp will on be responsible for running this pass but includes no actual implementation.

};

using SYCLDeviceLibFuncMap = std::unordered_map<std::string, DeviceLibExt>;
class SYCLDeviceLibReqMaskPass : public ModulePass {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this pass is designed for a legacy pass manager, could you please rename it to SYCLDeviceLibReqMaskLegacyPass? Or even better, rewrite it to use new pass manager infrastructure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, @AlexeySachkov
I agree it is better to use new pass manager but it looks like legacy pass manager has already been used in sycl-post-link.cpp in several places, I would like to use legacy pass manager in this patch and draft a new patch to replace all legacy pass manager with new pass manager.
Thanks very much.

llvm/tools/sycl-post-link/SYCLDeviceLibReqMask.h Outdated Show resolved Hide resolved
llvm/tools/sycl-post-link/SYCLDeviceLibReqMask.h Outdated Show resolved Hide resolved
llvm/tools/sycl-post-link/SYCLDeviceLibReqMask.h Outdated Show resolved Hide resolved
Signed-off-by: gejin <ge.jin@intel.com>
Copy link
Contributor

@kbobrovs kbobrovs left a comment

Choose a reason for hiding this comment

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

+1 for this. But please state the motive in the description.

@jinge90
Copy link
Contributor Author

jinge90 commented Mar 4, 2021

/summary:run

@romanovvlad romanovvlad merged commit a1d362f into intel:sycl Mar 4, 2021
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