Added option -align-loops=<true/false> to disable loop aligner pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-02-28 23:29:57 +00:00
parent 9b80bd8ea2
commit d703ed6aed
4 changed files with 7 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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));

View File

@ -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,