aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PostRASchedulerList.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-10-16 21:06:15 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-10-16 21:06:15 +0000
commit007ceb46039daf322651ab02c26fd8993bad2144 (patch)
tree925221a321dbcd5cec528f0a4404256314862b45 /llvm/lib/CodeGen/PostRASchedulerList.cpp
parent5a2863856013abfc56fd884810567a7177917c2c (diff)
downloadllvm-007ceb46039daf322651ab02c26fd8993bad2144.zip
llvm-007ceb46039daf322651ab02c26fd8993bad2144.tar.gz
llvm-007ceb46039daf322651ab02c26fd8993bad2144.tar.bz2
Change createPostRAScheduler so it can be turned off at llc -O1.
llvm-svn: 84273
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--llvm/lib/CodeGen/PostRASchedulerList.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 706f5f2..4da5496 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -78,10 +78,12 @@ DebugMod("postra-sched-debugmod",
namespace {
class VISIBILITY_HIDDEN PostRAScheduler : public MachineFunctionPass {
AliasAnalysis *AA;
+ CodeGenOpt::Level OptLevel;
public:
static char ID;
- PostRAScheduler() : MachineFunctionPass(&ID) {}
+ PostRAScheduler(CodeGenOpt::Level ol) :
+ MachineFunctionPass(&ID), OptLevel(ol) {}
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
@@ -238,7 +240,7 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
} else {
// Check that post-RA scheduling is enabled for this target.
const TargetSubtarget &ST = Fn.getTarget().getSubtarget<TargetSubtarget>();
- if (!ST.enablePostRAScheduler())
+ if (!ST.enablePostRAScheduler(OptLevel))
return false;
}
@@ -1195,6 +1197,6 @@ void SchedulePostRATDList::ListScheduleTopDown() {
// Public Constructor Functions
//===----------------------------------------------------------------------===//
-FunctionPass *llvm::createPostRAScheduler() {
- return new PostRAScheduler();
+FunctionPass *llvm::createPostRAScheduler(CodeGenOpt::Level OptLevel) {
+ return new PostRAScheduler(OptLevel);
}