summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2017-09-13 17:10:24 +0000
committerTeresa Johnson <tejohnson@google.com>2017-09-13 17:10:24 +0000
commitcbdc5ff628535761663367ab67621087aadd0d5f (patch)
tree6263a4133e78f8792e305522f3c8f3ef9bf5bbc1 /llvm
parentd067c8ed59ccd8a74f266c9fd06c9cfbdef834a1 (diff)
downloadbcm5719-llvm-cbdc5ff628535761663367ab67621087aadd0d5f.tar.gz
bcm5719-llvm-cbdc5ff628535761663367ab67621087aadd0d5f.zip
[ThinLTO] AliasSummary should not have any references
Summary: References should only be on the aliasee. Reviewers: pcc Subscribers: llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D37814 llvm-svn: 313158
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/IR/ModuleSummaryIndex.h9
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp2
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp5
3 files changed, 9 insertions, 7 deletions
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index 23ec2eed46e..1ffd81b5ec0 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -185,7 +185,10 @@ private:
protected:
GlobalValueSummary(SummaryKind K, GVFlags Flags, std::vector<ValueInfo> Refs)
- : Kind(K), Flags(Flags), RefEdgeList(std::move(Refs)) {}
+ : Kind(K), Flags(Flags), RefEdgeList(std::move(Refs)) {
+ assert((K != AliasKind || Refs.empty()) &&
+ "Expect no references for AliasSummary");
+ }
public:
virtual ~GlobalValueSummary() = default;
@@ -242,8 +245,8 @@ class AliasSummary : public GlobalValueSummary {
GlobalValueSummary *AliaseeSummary;
public:
- AliasSummary(GVFlags Flags, std::vector<ValueInfo> Refs)
- : GlobalValueSummary(AliasKind, Flags, std::move(Refs)) {}
+ AliasSummary(GVFlags Flags)
+ : GlobalValueSummary(AliasKind, Flags, ArrayRef<ValueInfo>{}) {}
/// Check if this is an alias summary.
static bool classof(const GlobalValueSummary *GVS) {
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index 2b355deade3..afd575e7273 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -343,7 +343,7 @@ computeAliasSummary(ModuleSummaryIndex &Index, const GlobalAlias &A,
bool NonRenamableLocal = isNonRenamableLocal(A);
GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal,
/* Live = */ false);
- auto AS = llvm::make_unique<AliasSummary>(Flags, ArrayRef<ValueInfo>{});
+ auto AS = llvm::make_unique<AliasSummary>(Flags);
auto *Aliasee = A.getBaseObject();
auto *AliaseeSummary = Index.getGlobalValueSummary(*Aliasee);
assert(AliaseeSummary && "Alias expects aliasee summary to be parsed");
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 538aad09cf5..560a71bbf76 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -5159,8 +5159,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
uint64_t RawFlags = Record[1];
unsigned AliaseeID = Record[2];
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
- auto AS =
- llvm::make_unique<AliasSummary>(Flags, std::vector<ValueInfo>{});
+ auto AS = llvm::make_unique<AliasSummary>(Flags);
// The module path string ref set in the summary must be owned by the
// index's module string table. Since we don't have a module path
// string table section in the per-module index, we create a single
@@ -5253,7 +5252,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
uint64_t RawFlags = Record[2];
unsigned AliaseeValueId = Record[3];
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
- auto AS = llvm::make_unique<AliasSummary>(Flags, std::vector<ValueInfo>{});
+ auto AS = llvm::make_unique<AliasSummary>(Flags);
LastSeenSummary = AS.get();
AS->setModulePath(ModuleIdMap[ModuleId]);
OpenPOWER on IntegriCloud