diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-08-02 13:10:52 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-08-02 13:10:52 +0000 |
commit | d2df54e6a55af509b08afa109fe522cd88ad1c33 (patch) | |
tree | 4d339b3b6a25b26612d1c76e97da2ae43ba44227 /llvm/tools | |
parent | 4cfd015bebb6966227964070c6bea738eaf897ae (diff) | |
download | bcm5719-llvm-d2df54e6a55af509b08afa109fe522cd88ad1c33.tar.gz bcm5719-llvm-d2df54e6a55af509b08afa109fe522cd88ad1c33.zip |
[ThinLTO] Implement index-based WPD
This patch adds support to the WholeProgramDevirt pass to perform
index-based WPD, which is invoked from ThinLTO during the thin link.
The ThinLTO backend (WPD import phase) behaves the same regardless of
whether the WPD decisions were made with the index-based or (the
existing) IR-based analysis.
Depends on D54815.
Reviewers: pcc
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, arphaman, dang, llvm-commits
Differential Revision: https://reviews.llvm.org/D55153
llvm-svn: 367679
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-lto2/llvm-lto2.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp index 0bd9289dc93..0adb048b18e 100644 --- a/llvm/tools/llvm-lto2/llvm-lto2.cpp +++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp @@ -291,6 +291,14 @@ static int run(int argc, char **argv) { std::vector<SymbolResolution> Res; for (const InputFile::Symbol &Sym : Input->symbols()) { auto I = CommandLineResolutions.find({F, Sym.getName()}); + // If it isn't found, look for "$", which would have been added + // (followed by a hash) when the symbol was promoted during module + // splitting if it was defined in one part and used in the other. + // Try looking up the symbol name before the "$". + if (I == CommandLineResolutions.end()) { + auto SplitName = Sym.getName().rsplit("$"); + I = CommandLineResolutions.find({F, SplitName.first}); + } if (I == CommandLineResolutions.end()) { llvm::errs() << argv[0] << ": missing symbol resolution for " << F << ',' << Sym.getName() << '\n'; |