aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-01-04 08:11:03 +0000
committerBill Wendling <isanbard@gmail.com>2008-01-04 08:11:03 +0000
commit4aab7ae1bb860f54be28dd3819017337b28faeba (patch)
tree255778e386e2ea42d281ea5258bfff859f296a37 /lib/CodeGen
parentb43ca19cacd0bee7aa506ac6db7bde56abc67c9f (diff)
downloadexternal_llvm-4aab7ae1bb860f54be28dd3819017337b28faeba.zip
external_llvm-4aab7ae1bb860f54be28dd3819017337b28faeba.tar.gz
external_llvm-4aab7ae1bb860f54be28dd3819017337b28faeba.tar.bz2
Move option to enable machine LICM into LLVMTargetMachine.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp11
-rw-r--r--lib/CodeGen/MachineLICM.cpp10
2 files changed, 8 insertions, 13 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 6a8e775..15c1d67 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -33,7 +33,10 @@ static cl::opt<bool> PrintEmittedAsm("print-emitted-asm", cl::Hidden,
static cl::opt<bool>
EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
cl::desc("Perform sinking on machine code"));
-
+static cl::opt<bool>
+PerformLICM("machine-licm",
+ cl::init(false), cl::Hidden,
+ cl::desc("Perform loop-invariant code motion on machine code"));
FileModel::Model
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
@@ -73,7 +76,8 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(cerr));
- PM.add(createMachineLICMPass());
+ if (PerformLICM)
+ PM.add(createMachineLICMPass());
if (EnableSinking)
PM.add(createMachineSinkingPass());
@@ -187,7 +191,8 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM,
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(cerr));
- PM.add(createMachineLICMPass());
+ if (PerformLICM)
+ PM.add(createMachineLICMPass());
// Perform register allocation to convert to a concrete x86 representation
PM.add(createRegisterAllocator());
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index f33acf4..e6b9c76 100644
--- a/lib/CodeGen/MachineLICM.cpp
+++ b/lib/CodeGen/MachineLICM.cpp
@@ -28,14 +28,6 @@
using namespace llvm;
-namespace {
- // Hidden options to help debugging
- cl::opt<bool>
- PerformLICM("machine-licm",
- cl::init(false), cl::Hidden,
- cl::desc("Perform loop-invariant code motion on machine code"));
-}
-
STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops");
namespace {
@@ -167,8 +159,6 @@ FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); }
/// loop.
///
bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
- if (!PerformLICM) return false; // For debugging.
-
DOUT << "******** Machine LICM ********\n";
Changed = false;