[Analysis][AIX] Add !implicit.ref globals as ThinLTO summary ref edges to support pragma comment(copyright) LTO interaction#199398
Draft
tonykuttai wants to merge 5 commits into
Draft
[Analysis][AIX] Add !implicit.ref globals as ThinLTO summary ref edges to support pragma comment(copyright) LTO interaction#199398tonykuttai wants to merge 5 commits into
tonykuttai wants to merge 5 commits into
Conversation
- Emit !aix.copyright.comment from Clang for the pragma. - Lower it in LLVM to a TU-local string + llvm.used + !implicit.ref. - Add module-import and backend relocation tests.
Co-authored-by: Hubert Tong <hubert.reinterpretcast@gmail.com>
…imeComment() to the end of the class.
…s to support pragma comment(copyright) LTO interaction Teach ModuleSummaryAnalysis to include globals referenced via !implicit.ref metadata as explicit reference edges in the ThinLTO module summary via a new helper findImplicitRefEdges.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: This PR adds LTO support for the pragma comment copyright feature implemented in #178184. Should be reviewed/merged after #178184.
LowerCommentStringPassimplements#pragma comment(copyright, ...)on AIX by creating a TU-local@__loadtime_comment_strglobal in the__loadtime_commentsection and attaching!implicit.refmetadata to alldefined functions. The PowerPC backend reads
!implicit.refand emits.refdirectives from each function csect to the copyright string csect, so the AIX XCOFF linker keeps the copyright string alive whenever any function from the TU is live.This change teaches
ModuleSummaryAnalysisto include globals referenced via!implicit.refmetadata as explicit reference edges in the ThinLTO module summary via a new helperfindImplicitRefEdges.