Remove dead blocks
authorChris Lattner <sabre@nondot.org>
Fri, 2 Jul 2004 05:46:41 +0000 (05:46 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 2 Jul 2004 05:46:41 +0000 (05:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14564 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetMachine.cpp

index f1f003ba074c853d5080d94bc815bbaf8ac39a51..a2efb034f5f064fa15cf5041c03d99795b1b39fa 100644 (file)
@@ -68,6 +68,9 @@ bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
   // FIXME: Implement the switch instruction in the instruction selector!
   PM.add(createLowerSwitchPass());
 
+  // Make sure that no unreachable blocks are instruction selected.
+  PM.add(createUnreachableBlockEliminationPass());
+
   if (NoPatternISel && NoSimpleISel)
     PM.add(createX86SimpleInstructionSelector(*this));
   else if (NoPatternISel)
@@ -125,6 +128,9 @@ void X86JITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
   // FIXME: Implement the switch instruction in the instruction selector!
   PM.add(createLowerSwitchPass());
 
+  // Make sure that no unreachable blocks are instruction selected.
+  PM.add(createUnreachableBlockEliminationPass());
+
   if (NoPatternISel)
     PM.add(createX86SimpleInstructionSelector(TM));
   else