Add a command line option to disable global merge pass.

llvm-svn: 138536
This commit is contained in:
Evan Cheng 2011-08-25 01:00:36 +00:00
parent 5be8a4d104
commit f066b2fe99
1 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,11 @@
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
static cl::opt<bool>
EnableGlobalMerge("global-merge",
cl::desc("Enable global merge pass"),
cl::init(true));
extern "C" void LLVMInitializeARMTarget() {
// Register the target.
RegisterTargetMachine<ARMTargetMachine> X(TheARMTarget);
@ -83,7 +88,7 @@ ThumbTargetMachine::ThumbTargetMachine(const Target &T, StringRef TT,
bool ARMBaseTargetMachine::addPreISel(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
if (OptLevel != CodeGenOpt::None)
if (OptLevel != CodeGenOpt::None && EnableGlobalMerge)
PM.add(createARMGlobalMergePass(getTargetLowering()));
return false;