mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-26 02:22:29 +00:00
GlobalMerge: move "-global-merge" option to the pass itself.
It's rather odd to have the flag enabling and disabling this pass only affect a single target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -23,11 +23,6 @@
|
|||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
static cl::opt<bool>
|
|
||||||
EnableGlobalMerge("global-merge", cl::Hidden,
|
|
||||||
cl::desc("Enable global merge pass"),
|
|
||||||
cl::init(true));
|
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
DisableA15SDOptimization("disable-a15-sd-optimization", cl::Hidden,
|
DisableA15SDOptimization("disable-a15-sd-optimization", cl::Hidden,
|
||||||
cl::desc("Inhibit optimization of S->D register accesses on A15"),
|
cl::desc("Inhibit optimization of S->D register accesses on A15"),
|
||||||
@@ -184,7 +179,7 @@ TargetPassConfig *ARMBaseTargetMachine::createPassConfig(PassManagerBase &PM) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ARMPassConfig::addPreISel() {
|
bool ARMPassConfig::addPreISel() {
|
||||||
if (TM->getOptLevel() != CodeGenOpt::None && EnableGlobalMerge)
|
if (TM->getOptLevel() != CodeGenOpt::None)
|
||||||
addPass(createGlobalMergePass(TM));
|
addPass(createGlobalMergePass(TM));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -70,6 +70,11 @@
|
|||||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
EnableGlobalMerge("global-merge", cl::Hidden,
|
||||||
|
cl::desc("Enable global merge pass"),
|
||||||
|
cl::init(true));
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
EnableGlobalMergeOnConst("global-merge-on-const", cl::Hidden,
|
EnableGlobalMergeOnConst("global-merge-on-const", cl::Hidden,
|
||||||
cl::desc("Enable global merge pass on constants"),
|
cl::desc("Enable global merge pass on constants"),
|
||||||
@@ -231,6 +236,9 @@ void GlobalMerge::setMustKeepGlobalVariables(Module &M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GlobalMerge::doInitialization(Module &M) {
|
bool GlobalMerge::doInitialization(Module &M) {
|
||||||
|
if (!EnableGlobalMerge)
|
||||||
|
return false;
|
||||||
|
|
||||||
DenseMap<unsigned, SmallVector<GlobalVariable*, 16> > Globals, ConstGlobals,
|
DenseMap<unsigned, SmallVector<GlobalVariable*, 16> > Globals, ConstGlobals,
|
||||||
BSSGlobals;
|
BSSGlobals;
|
||||||
const TargetLowering *TLI = TM->getTargetLowering();
|
const TargetLowering *TLI = TM->getTargetLowering();
|
||||||
|
|||||||
Reference in New Issue
Block a user