aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ModuleSummaryIndex.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-03-15 15:11:38 +0000
committerTeresa Johnson <tejohnson@google.com>2019-03-15 15:11:38 +0000
commit70ec64cb7235efbeb1a7c6c4f9b5810d866850ec (patch)
treea845f0a5ab7355e9f5a09158b8918bc61ed00920 /llvm/lib/IR/ModuleSummaryIndex.cpp
parent55e1330edaa5fef8be2ae892dd1964d2ea895578 (diff)
downloadllvm-70ec64cb7235efbeb1a7c6c4f9b5810d866850ec.zip
llvm-70ec64cb7235efbeb1a7c6c4f9b5810d866850ec.tar.gz
llvm-70ec64cb7235efbeb1a7c6c4f9b5810d866850ec.tar.bz2
[ThinLTO] Restructure AliasSummary to contain ValueInfo of Aliasee
Summary: The AliasSummary previously contained the AliaseeGUID, which was only populated when reading the summary from bitcode. This patch changes it to instead hold the ValueInfo of the aliasee, and always populates it. This enables more efficient access to the ValueInfo (specifically in the recent patch r352438 which needed to perform an index hash table lookup using the aliasee GUID). As noted in the comments in AliasSummary, we no longer technically need to keep a pointer to the corresponding aliasee summary, since it could be obtained by walking the list of summaries on the ValueInfo looking for the summary in the same module. However, I am concerned that this would be inefficient when walking through the index during the thin link for various analyses. That can be reevaluated in the future. By always populating this new field, we can remove the guard and special handling for a 0 aliasee GUID when dumping the dot graph of the summary. An additional improvement in this patch is when reading the summaries from LLVM assembly we now set the AliaseeSummary field to the aliasee summary in that same module, which makes it consistent with the behavior when reading the summary from bitcode. Reviewers: pcc, mehdi_amini Subscribers: inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D57470 llvm-svn: 356268
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r--llvm/lib/IR/ModuleSummaryIndex.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index 6ae6285..4704215 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -418,17 +418,7 @@ void ModuleSummaryIndex::exportToDot(raw_ostream &OS) const {
Draw(SummaryIt.first, R.getGUID(), R.isReadOnly() ? -1 : -2);
if (auto *AS = dyn_cast_or_null<AliasSummary>(SummaryIt.second)) {
- GlobalValue::GUID AliaseeId;
- if (AS->hasAliaseeGUID())
- AliaseeId = AS->getAliaseeGUID();
- else {
- auto AliaseeOrigId = AS->getAliasee().getOriginalName();
- AliaseeId = getGUIDFromOriginalID(AliaseeOrigId);
- if (!AliaseeId)
- AliaseeId = AliaseeOrigId;
- }
-
- Draw(SummaryIt.first, AliaseeId, -3);
+ Draw(SummaryIt.first, AS->getAliaseeGUID(), -3);
continue;
}