summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-06-27 17:10:33 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-06-27 17:10:33 +0000
commita58862310cb510b75d77b8cf156d8bb5192b7e20 (patch)
tree7c799f1976d3a6b60a4d5defe1bca3c8c346d6b3 /llvm/lib/Transforms
parent1669f70273cd26d21aa775802809f40cc244cd5b (diff)
downloadbcm5719-llvm-a58862310cb510b75d77b8cf156d8bb5192b7e20.tar.gz
bcm5719-llvm-a58862310cb510b75d77b8cf156d8bb5192b7e20.zip
Revert r159136 due to PR13124.
Original commit message: If a constant or a function has linkonce_odr linkage and unnamed_addr, mark it hidden. Being linkonce_odr guarantees that it is available in every dso that needs it. Being a constant/function with unnamed_addr guarantees that the copies don't have to be merged. llvm-svn: 159272
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 2f1af187f92..35f98b22653 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1731,12 +1731,6 @@ bool GlobalOpt::ProcessGlobal(GlobalVariable *GV,
return true;
}
- if (GV->hasLinkOnceODRLinkage() && GV->hasUnnamedAddr() && GV->isConstant() &&
- GV->getVisibility() != GlobalValue::HiddenVisibility) {
- GV->setVisibility(GlobalValue::HiddenVisibility);
- return true;
- }
-
if (!GV->hasLocalLinkage())
return false;
@@ -1749,7 +1743,6 @@ bool GlobalOpt::ProcessGlobal(GlobalVariable *GV,
if (!GS.isCompared && !GV->hasUnnamedAddr()) {
GV->setUnnamedAddr(true);
NumUnnamed++;
- return true;
}
if (GV->isConstant() || !GV->hasInitializer())
@@ -1924,10 +1917,6 @@ bool GlobalOpt::OptimizeFunctions(Module &M) {
F->eraseFromParent();
Changed = true;
++NumFnDeleted;
- } else if (F->hasLinkOnceODRLinkage() && F->hasUnnamedAddr() &&
- F->getVisibility() != GlobalValue::HiddenVisibility) {
- F->setVisibility(GlobalValue::HiddenVisibility);
- Changed = true;
} else if (F->hasLocalLinkage()) {
if (F->getCallingConv() == CallingConv::C && !F->isVarArg() &&
!F->hasAddressTaken()) {
OpenPOWER on IntegriCloud