aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r--contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp b/contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp
index ca7ebf98c5..5d21ca759f 100644
--- a/contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp
+++ b/contrib/libs/llvm12/lib/IR/ModuleSummaryIndex.cpp
@@ -163,9 +163,9 @@ bool ModuleSummaryIndex::isGUIDLive(GlobalValue::GUID GUID) const {
return false;
}
-static void
-propagateAttributesToRefs(GlobalValueSummary *S,
- DenseSet<ValueInfo> &MarkedNonReadWriteOnly) {
+static void
+propagateAttributesToRefs(GlobalValueSummary *S,
+ DenseSet<ValueInfo> &MarkedNonReadWriteOnly) {
// If reference is not readonly or writeonly then referenced summary is not
// read/writeonly either. Note that:
// - All references from GlobalVarSummary are conservatively considered as
@@ -176,11 +176,11 @@ propagateAttributesToRefs(GlobalValueSummary *S,
// for them.
for (auto &VI : S->refs()) {
assert(VI.getAccessSpecifier() == 0 || isa<FunctionSummary>(S));
- if (!VI.getAccessSpecifier()) {
- if (!MarkedNonReadWriteOnly.insert(VI).second)
- continue;
- } else if (MarkedNonReadWriteOnly.contains(VI))
- continue;
+ if (!VI.getAccessSpecifier()) {
+ if (!MarkedNonReadWriteOnly.insert(VI).second)
+ continue;
+ } else if (MarkedNonReadWriteOnly.contains(VI))
+ continue;
for (auto &Ref : VI.getSummaryList())
// If references to alias is not read/writeonly then aliasee
// is not read/writeonly
@@ -223,24 +223,24 @@ void ModuleSummaryIndex::propagateAttributes(
const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols) {
if (!PropagateAttrs)
return;
- DenseSet<ValueInfo> MarkedNonReadWriteOnly;
+ DenseSet<ValueInfo> MarkedNonReadWriteOnly;
for (auto &P : *this)
for (auto &S : P.second.SummaryList) {
- if (!isGlobalValueLive(S.get())) {
- // computeDeadSymbols should have marked all copies live. Note that
- // it is possible that there is a GUID collision between internal
- // symbols with the same name in different files of the same name but
- // not enough distinguishing path. Because computeDeadSymbols should
- // conservatively mark all copies live we can assert here that all are
- // dead if any copy is dead.
- assert(llvm::none_of(
- P.second.SummaryList,
- [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
- return isGlobalValueLive(Summary.get());
- }));
+ if (!isGlobalValueLive(S.get())) {
+ // computeDeadSymbols should have marked all copies live. Note that
+ // it is possible that there is a GUID collision between internal
+ // symbols with the same name in different files of the same name but
+ // not enough distinguishing path. Because computeDeadSymbols should
+ // conservatively mark all copies live we can assert here that all are
+ // dead if any copy is dead.
+ assert(llvm::none_of(
+ P.second.SummaryList,
+ [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
+ return isGlobalValueLive(Summary.get());
+ }));
// We don't examine references from dead objects
- break;
- }
+ break;
+ }
// Global variable can't be marked read/writeonly if it is not eligible
// to import since we need to ensure that all external references get
@@ -260,7 +260,7 @@ void ModuleSummaryIndex::propagateAttributes(
GVS->setReadOnly(false);
GVS->setWriteOnly(false);
}
- propagateAttributesToRefs(S.get(), MarkedNonReadWriteOnly);
+ propagateAttributesToRefs(S.get(), MarkedNonReadWriteOnly);
}
setWithAttributePropagation();
if (llvm::AreStatisticsEnabled())