Add a command line option to disable global merge pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2011-08-25 01:00:36 +00:00
parent 0f660260e6
commit b8cfe4ff41

View File

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