mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +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" | ||||
| 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> | ||||
| DisableA15SDOptimization("disable-a15-sd-optimization", cl::Hidden, | ||||
|                    cl::desc("Inhibit optimization of S->D register accesses on A15"), | ||||
| @@ -184,7 +179,7 @@ TargetPassConfig *ARMBaseTargetMachine::createPassConfig(PassManagerBase &PM) { | ||||
| } | ||||
|  | ||||
| bool ARMPassConfig::addPreISel() { | ||||
|   if (TM->getOptLevel() != CodeGenOpt::None && EnableGlobalMerge) | ||||
|   if (TM->getOptLevel() != CodeGenOpt::None) | ||||
|     addPass(createGlobalMergePass(TM)); | ||||
|  | ||||
|   return false; | ||||
|   | ||||
| @@ -70,6 +70,11 @@ | ||||
| #include "llvm/Target/TargetLoweringObjectFile.h" | ||||
| 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> | ||||
| EnableGlobalMergeOnConst("global-merge-on-const", cl::Hidden, | ||||
|                          cl::desc("Enable global merge pass on constants"), | ||||
| @@ -231,6 +236,9 @@ void GlobalMerge::setMustKeepGlobalVariables(Module &M) { | ||||
| } | ||||
|  | ||||
| bool GlobalMerge::doInitialization(Module &M) { | ||||
|   if (!EnableGlobalMerge) | ||||
|     return false; | ||||
|  | ||||
|   DenseMap<unsigned, SmallVector<GlobalVariable*, 16> > Globals, ConstGlobals, | ||||
|                                                         BSSGlobals; | ||||
|   const TargetLowering *TLI = TM->getTargetLowering(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user