Fix failures in 099.go due to the cfgsimplify pass creating switch instructions
where there did not used to be any before
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11829 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index 83a390e..4886a11 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -59,9 +59,6 @@
// does to emit statically compiled machine code.
bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
std::ostream &Out) {
- // FIXME: Implement the switch instruction in the instruction selector!
- PM.add(createLowerSwitchPass());
-
// FIXME: Implement the invoke/unwind instructions!
PM.add(createLowerInvokePass());
@@ -69,6 +66,9 @@
// unreachable basic blocks.
PM.add(createCFGSimplificationPass());
+ // FIXME: Implement the switch instruction in the instruction selector!
+ PM.add(createLowerSwitchPass());
+
if (NoPatternISel)
PM.add(createX86SimpleInstructionSelector(*this));
else
@@ -115,8 +115,6 @@
/// not supported for this target.
///
void X86JITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
- // FIXME: Implement the switch instruction in the instruction selector!
- PM.add(createLowerSwitchPass());
// FIXME: Implement the invoke/unwind instructions!
PM.add(createLowerInvokePass());
@@ -125,6 +123,9 @@
// unreachable basic blocks.
PM.add(createCFGSimplificationPass());
+ // FIXME: Implement the switch instruction in the instruction selector!
+ PM.add(createLowerSwitchPass());
+
if (NoPatternISel)
PM.add(createX86SimpleInstructionSelector(TM));
else