[llvm-commits] [llvm] r47736 - in /llvm/trunk/lib: CodeGen/LLVMTargetMachine.cpp CodeGen/LoopAligner.cpp Target/X86/X86TargetMachine.cpp Target/X86/X86TargetMachine.h
Evan Cheng
evan.cheng at apple.com
Thu Feb 28 15:29:57 PST 2008
Author: evancheng
Date: Thu Feb 28 17:29:57 2008
New Revision: 47736
URL: http://llvm.org/viewvc/llvm-project?rev=47736&view=rev
Log:
Added option -align-loops=<true/false> to disable loop aligner pass.
Modified:
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
llvm/trunk/lib/CodeGen/LoopAligner.cpp
llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
llvm/trunk/lib/Target/X86/X86TargetMachine.h
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=47736&r1=47735&r2=47736&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Feb 28 17:29:57 2008
@@ -37,6 +37,9 @@
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 @@
if (addPreEmitPass(PM, Fast) && PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(cerr));
+ if (AlignLoops)
+ PM.add(createLoopAlignerPass());
+
switch (FileType) {
default:
break;
Modified: llvm/trunk/lib/CodeGen/LoopAligner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LoopAligner.cpp?rev=47736&r1=47735&r2=47736&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LoopAligner.cpp (original)
+++ llvm/trunk/lib/CodeGen/LoopAligner.cpp Thu Feb 28 17:29:57 2008
@@ -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;
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=47736&r1=47735&r2=47736&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Thu Feb 28 17:29:57 2008
@@ -164,13 +164,6 @@
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));
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=47736&r1=47735&r2=47736&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Thu Feb 28 17:29:57 2008
@@ -63,7 +63,6 @@
// 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,
More information about the llvm-commits
mailing list