diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-28 23:29:57 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-28 23:29:57 +0000 |
commit | 95a7be473c5818291e3b05677a6009f46fade16d (patch) | |
tree | a0d88447d1a24f7362919305d3416403d2d0c53c /llvm/lib | |
parent | bb979f4b1cae38b777b1b2f5ccf9d19050e5c3f4 (diff) | |
download | bcm5719-llvm-95a7be473c5818291e3b05677a6009f46fade16d.tar.gz bcm5719-llvm-95a7be473c5818291e3b05677a6009f46fade16d.zip |
Added option -align-loops=<true/false> to disable loop aligner pass.
llvm-svn: 47736
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LoopAligner.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.h | 1 |
4 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 5611b03ba76..32fbc15e131 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -37,6 +37,9 @@ static cl::opt<bool> EnableSinking("enable-sinking", cl::init(false), cl::Hidden, cl::desc("Perform sinking on machine code")); static cl::opt<bool> +AlignLoops("align-loops", cl::init(true), cl::Hidden, + cl::desc("Align loop headers")); +static cl::opt<bool> PerformLICM("machine-licm", cl::init(false), cl::Hidden, cl::desc("Perform loop-invariant code motion on machine code")); @@ -132,6 +135,9 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, if (addPreEmitPass(PM, Fast) && PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); + if (AlignLoops) + PM.add(createLoopAlignerPass()); + switch (FileType) { default: break; diff --git a/llvm/lib/CodeGen/LoopAligner.cpp b/llvm/lib/CodeGen/LoopAligner.cpp index a40bb50565d..c5a3f549a76 100644 --- a/llvm/lib/CodeGen/LoopAligner.cpp +++ b/llvm/lib/CodeGen/LoopAligner.cpp @@ -18,6 +18,7 @@ #include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" using namespace llvm; diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index ad2775a6484..850eb386fb5 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -164,13 +164,6 @@ bool X86TargetMachine::addPostRegAlloc(FunctionPassManager &PM, bool Fast) { return true; // -print-machineinstr should print after this. } -bool X86TargetMachine::addPreEmitPass(FunctionPassManager &PM, bool Fast) { - if (Fast) return false; - - PM.add(createLoopAlignerPass()); - return true; -} - bool X86TargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out) { PM.add(createX86CodePrinterPass(Out, *this)); diff --git a/llvm/lib/Target/X86/X86TargetMachine.h b/llvm/lib/Target/X86/X86TargetMachine.h index 61e4451d7ab..e9148b5a52e 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.h +++ b/llvm/lib/Target/X86/X86TargetMachine.h @@ -63,7 +63,6 @@ public: // Set up the pass pipeline. virtual bool addInstSelector(FunctionPassManager &PM, bool Fast); virtual bool addPostRegAlloc(FunctionPassManager &PM, bool Fast); - virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast); virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out); virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, |