don't create the post-ra scheduler unless it is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45972 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index b655435..351554b 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -41,6 +41,12 @@
cl::init(false), cl::Hidden,
cl::desc("Perform loop-invariant code motion on machine code"));
+// When this works it will be on by default.
+static cl::opt<bool>
+DisablePostRAScheduler("disable-post-RA-scheduler",
+ cl::desc("Disable scheduling after register allocation"),
+ cl::init(true));
+
FileModel::Model
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
std::ostream &Out,
@@ -103,7 +109,7 @@
PM.add(createPrologEpilogCodeInserter());
// Second pass scheduler.
- if (!Fast)
+ if (!Fast && !DisablePostRAScheduler)
PM.add(createPostRAScheduler());
// Branch folding must be run after regalloc and prolog/epilog insertion.