Skip to content

Commit 10d3137

Browse files
committed
Remove unused MergePrivateGlobals
1 parent 4e4a4da commit 10d3137

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

llvm/include/llvm/CodeGen/GlobalMerge.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ struct GlobalMergeOptions {
2828
bool MergeConst = false;
2929
/// Whether we should merge global variables that have external linkage.
3030
bool MergeExternal = true;
31-
/// Whether we should merge global variables that have private linkage.
32-
bool MergePrivateGlobals = false;
3331
/// Whether we should merge constant global variables.
3432
bool MergeConstantGlobals = false;
3533
/// Whether we should try to optimize for size only.

llvm/include/llvm/CodeGen/Passes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ namespace llvm {
477477
Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
478478
bool OnlyOptimizeForSize = false,
479479
bool MergeExternalByDefault = false,
480-
bool MergePrivateByDefault = false,
481480
bool MergeConstantByDefault = false);
482481

483482
/// This pass splits the stack into a safe stack and an unsafe stack to

llvm/lib/CodeGen/GlobalMerge.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,11 @@ class GlobalMerge : public FunctionPass {
197197

198198
explicit GlobalMerge(const TargetMachine *TM, unsigned MaximalOffset,
199199
bool OnlyOptimizeForSize, bool MergeExternalGlobals,
200-
bool MergePrivateGlobals, bool MergeConstantGlobals)
200+
bool MergeConstantGlobals)
201201
: FunctionPass(ID), TM(TM) {
202202
Opt.MaxOffset = MaximalOffset;
203203
Opt.SizeOnly = OnlyOptimizeForSize;
204204
Opt.MergeExternal = MergeExternalGlobals;
205-
Opt.MergePrivateGlobals = MergePrivateGlobals;
206205
Opt.MergeConstantGlobals = MergeConstantGlobals;
207206
initializeGlobalMergePass(*PassRegistry::getPassRegistry());
208207
}
@@ -732,13 +731,10 @@ bool GlobalMergeImpl::run(Module &M) {
732731
Pass *llvm::createGlobalMergePass(const TargetMachine *TM, unsigned Offset,
733732
bool OnlyOptimizeForSize,
734733
bool MergeExternalByDefault,
735-
bool MergePrivateByDefault,
736734
bool MergeConstantByDefault) {
737735
bool MergeExternal = (EnableGlobalMergeOnExternal == cl::BOU_UNSET) ?
738736
MergeExternalByDefault : (EnableGlobalMergeOnExternal == cl::BOU_TRUE);
739-
bool MergeConstant = EnableGlobalMergeOnConst.getNumOccurrences() > 0
740-
? EnableGlobalMergeOnConst
741-
: MergeConstantByDefault;
737+
bool MergeConstant = EnableGlobalMergeOnConst || MergeConstantByDefault;
742738
return new GlobalMerge(TM, Offset, OnlyOptimizeForSize, MergeExternal,
743-
MergePrivateByDefault, MergeConstant);
739+
MergeConstant);
744740
}

llvm/lib/Target/PowerPC/PPCTargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ void PPCPassConfig::addIRPasses() {
501501

502502
bool PPCPassConfig::addPreISel() {
503503
if (EnableGlobalMerge)
504-
addPass(createGlobalMergePass(TM, GlobalMergeMaxOffset, false, false, true,
504+
addPass(createGlobalMergePass(TM, GlobalMergeMaxOffset, false, false,
505505
true));
506506

507507
if (MergeStringPool && getOptLevel() != CodeGenOptLevel::None)

0 commit comments

Comments
 (0)