Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeviceRTL] Allow IsSPMDMode to be optimized out in LTO mode
A previous patch merged the static and bitcode versions of the deviceRTL. We previously used the static library's separate compilation to set a special flag that prevented `IsSPMDMode` from being put in the used list and preventing it from being optimized out. When they were merged we could no longer do this separate compilation that allowed users of LTO to get more optimal code. This patch rearranges the code. The `IsSPMDMode` global is now transitively used by its inclusion in the changed `__keep_alive` function. This allows us to then manually delete the `__keep_alive` function from the module when building the static library via `llvm-extract`. The result is that the bitcode library correctly will maintain the needed shared state, while the static library will be able to internalize it and optimize it out. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D135280
- Loading branch information
Showing
5 changed files
with
28 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ omp_* | |
*llvm_* | ||
__kmpc_* | ||
|
||
__keep_alive | ||
IsSPMDMode | ||
|
||
memcmp | ||
printf | ||
__assert_fail |