From: Evan Cheng Date: Wed, 3 Mar 2010 01:38:35 +0000 (+0000) Subject: Add an option to enable machine cse (it's not doing anything yet. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=d89347cb49178da65a1c72cde5d54e79007d57ae;p=oota-llvm.git Add an option to enable machine cse (it's not doing anything yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97627 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 57930b79323..fd442db27a2 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -67,6 +67,9 @@ static cl::opt VerifyMachineCode("verify-machineinstrs", cl::Hidden, cl::desc("Verify generated machine code"), cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL)); +static cl::opt EnableMachineCSE("machine-cse", cl::Hidden, + cl::desc("Enable Machine CSE")); + static cl::opt AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), cl::init(cl::BOU_UNSET)); @@ -317,6 +320,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, if (OptLevel != CodeGenOpt::None) { PM.add(createOptimizeExtsPass()); + if (EnableMachineCSE) + PM.add(createMachineCSEPass()); if (!DisableMachineLICM) PM.add(createMachineLICMPass()); if (!DisableMachineSink)