summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-12-03 13:56:07 -0800
committerTeresa Johnson <tejohnson@google.com>2019-12-05 16:33:54 -0800
commit54a3c2a81e1a0ff970705008e9285ea3ada4ef3e (patch)
tree58cf5c7977c39448602bcda8ff84971d1330e6fb /llvm/lib/Transforms
parent2ec71ea7c74df20983031c6e1be07b14da0e9109 (diff)
downloadbcm5719-llvm-54a3c2a81e1a0ff970705008e9285ea3ada4ef3e.tar.gz
bcm5719-llvm-54a3c2a81e1a0ff970705008e9285ea3ada4ef3e.zip
[ThinLTO] Add option to disable readonly/writeonly attribute propagation
Summary: Add an option to allow the attribute propagation on the index to be disabled, to allow a workaround for issues (such as that fixed by D70977). Also move the setting of the WithAttributePropagation flag on the index into propagateAttributes(), and remove some old stale code that predated this flag and cleared the maybe read/write only bits when we need to disable the propagation (previously only when importing disabled, now also when the new option disables it). Reviewers: evgeny777, steven_wu Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70984
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index b21182af323..be0446a946e 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -901,19 +901,8 @@ void llvm::computeDeadSymbolsWithConstProp(
function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing,
bool ImportEnabled) {
computeDeadSymbols(Index, GUIDPreservedSymbols, isPrevailing);
- if (ImportEnabled) {
+ if (ImportEnabled)
Index.propagateAttributes(GUIDPreservedSymbols);
- } else {
- // If import is disabled we should drop read/write-only attribute
- // from all summaries to prevent internalization.
- for (auto &P : Index)
- for (auto &S : P.second.SummaryList)
- if (auto *GVS = dyn_cast<GlobalVarSummary>(S.get())) {
- GVS->setReadOnly(false);
- GVS->setWriteOnly(false);
- }
- }
- Index.setWithAttributePropagation();
}
/// Compute the set of summaries needed for a ThinLTO backend compilation of
OpenPOWER on IntegriCloud