-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MemProf] Allow promotion if target is a declaration (#115555)
Fixes an oversight in the MemProf ICP handling, that was blocking promotion/cloning of indirect calls when the profiled target is a declaration (i.e wasn't imported). There is no issue promoting in that case, and in fact the comment mentions we should attempt to at least import as declarations to enable more promotion. Note that normal ICP currently requires that the target be a definition, which is how this check ended up here. The comment there says that it must be a definition because ThinLTO could remove declarations for symbols found to be globally dead in the binary. However, here we are always performing MemProf ICP in the ThinLTO backends, which is after the globally dead symbols are removed (via dropDeadSymbols before starting the optimization pipeline) [1]. For now, guard this with an option (flag is off which means the new promotion is enabled by default) to simplify debugging or disabling it if this proves problematic. [1] In fact we could also be more aggressive in regular ICP when invoked in the ThinLTO backend
- Loading branch information
1 parent
1d41543
commit 3654183
Showing
2 changed files
with
122 additions
and
25 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