-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Always do internalization in sycl-post-link (#14976)
We already had `Internalize` pass being launched as part of a module cleanup phase in `sycl-post-link`, but it was only invoked when shared libraries/dynamic linking is enabled. However, there are other features that need this internalization and one (and the only, at least for now) is virtual functions. When virtual functions are used in a program it could be necessary to dynamically link several device images containing SYCL kernels together. The problem with that is that there are ITT instrumentation functions added to modules that have external linkage - they cause multiple definitions error when we try to link two kernels together, because both of them are instrumented. This problem is solved by running `Internalize` pass uncoditionally, but the criteria of what we can internalize depends on whether we enable shared libraries/dynamic linking support: - in regular flow, we can internalize any symbol that is not considered to be an entry point, because all device images are self-contained and there are no dependencies between them. - when dynamic linking is enabled, we should not internalize functions that can be imported/exported, even if they are not considered as module entry points. Tests were updated where necessary to expect or ignore linkage changes of some functions. InvokeSIMD pass had to be updated: ESIMD is handled through two-level device code split, meaning two cleanup phases where each of them could mistakenly drop some compiler-generated functions unless they are properly marked in LLVM IR.
- Loading branch information
1 parent
3b91b0b
commit 2137ff0
Showing
22 changed files
with
305 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.