aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp1
-rw-r--r--llvm/lib/IR/ModuleSummaryIndex.cpp14
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 376262b..b5db8bd 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -3041,6 +3041,7 @@ void AssemblyWriter::printSummary(const GlobalValueSummary &Summary) {
Out << ", notEligibleToImport: " << GVFlags.NotEligibleToImport;
Out << ", live: " << GVFlags.Live;
Out << ", dsoLocal: " << GVFlags.DSOLocal;
+ Out << ", canAutoHide: " << GVFlags.CanAutoHide;
Out << ")";
if (Summary.getSummaryKind() == GlobalValueSummary::AliasKind)
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index 4704215..18b7ac09 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -26,6 +26,7 @@ STATISTIC(ReadOnlyLiveGVars,
FunctionSummary FunctionSummary::ExternalNode =
FunctionSummary::makeDummyFunctionSummary({});
+
bool ValueInfo::isDSOLocal() const {
// Need to check all summaries are local in case of hash collisions.
return getSummaryList().size() &&
@@ -35,6 +36,15 @@ bool ValueInfo::isDSOLocal() const {
});
}
+bool ValueInfo::canAutoHide() const {
+ // Can only auto hide if all copies are eligible to auto hide.
+ return getSummaryList().size() &&
+ llvm::all_of(getSummaryList(),
+ [](const std::unique_ptr<GlobalValueSummary> &Summary) {
+ return Summary->canAutoHide();
+ });
+}
+
// Gets the number of immutable refs in RefEdgeList
unsigned FunctionSummary::immutableRefCount() const {
// Here we take advantage of having all readonly references
@@ -399,6 +409,10 @@ void ModuleSummaryIndex::exportToDot(raw_ostream &OS) const {
if (Flags.Live && hasReadOnlyFlag(SummaryIt.second))
A.addComment("immutable");
}
+ if (Flags.DSOLocal)
+ A.addComment("dsoLocal");
+ if (Flags.CanAutoHide)
+ A.addComment("canAutoHide");
auto VI = getValueInfo(SummaryIt.first);
A.add("label", getNodeLabel(VI, SummaryIt.second));