Fix potential problems with unreachable basic blocks.
authorChris Lattner <sabre@nondot.org>
Fri, 2 Jul 2004 05:49:11 +0000 (05:49 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 2 Jul 2004 05:49:11 +0000 (05:49 +0000)
Also, while noone's looking, add support for constant expressions.  Wait,
I said not to look!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14566 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcTargetMachine.cpp
lib/Target/SparcV8/SparcV8TargetMachine.cpp

index 344b88b81764646fc58372c7717fa38a462d127c..ed133489bed1004d302114b9e74dd421b791cd59 100644 (file)
@@ -56,6 +56,11 @@ bool SparcV8TargetMachine::addPassesToEmitAssembly(PassManager &PM,
   // FIXME: implement the invoke/unwind instructions!
   PM.add(createLowerInvokePass());
 
+  PM.add(createLowerConstantExpressionsPass());
+
+  // Make sure that no unreachable blocks are instruction selected.
+  PM.add(createUnreachableBlockEliminationPass());
+
   PM.add(createSparcV8SimpleInstructionSelector(*this));
 
   // Print machine instructions as they were initially generated.
@@ -102,7 +107,12 @@ void SparcV8JITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
 
   // FIXME: implement the invoke/unwind instructions!
   PM.add(createLowerInvokePass());
+
+  PM.add(createLowerConstantExpressionsPass());
   
+  // Make sure that no unreachable blocks are instruction selected.
+  PM.add(createUnreachableBlockEliminationPass());
+
   PM.add(createSparcV8SimpleInstructionSelector(TM));
 
   // Print machine instructions as they were initially generated.
index 344b88b81764646fc58372c7717fa38a462d127c..ed133489bed1004d302114b9e74dd421b791cd59 100644 (file)
@@ -56,6 +56,11 @@ bool SparcV8TargetMachine::addPassesToEmitAssembly(PassManager &PM,
   // FIXME: implement the invoke/unwind instructions!
   PM.add(createLowerInvokePass());
 
+  PM.add(createLowerConstantExpressionsPass());
+
+  // Make sure that no unreachable blocks are instruction selected.
+  PM.add(createUnreachableBlockEliminationPass());
+
   PM.add(createSparcV8SimpleInstructionSelector(*this));
 
   // Print machine instructions as they were initially generated.
@@ -102,7 +107,12 @@ void SparcV8JITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
 
   // FIXME: implement the invoke/unwind instructions!
   PM.add(createLowerInvokePass());
+
+  PM.add(createLowerConstantExpressionsPass());
   
+  // Make sure that no unreachable blocks are instruction selected.
+  PM.add(createUnreachableBlockEliminationPass());
+
   PM.add(createSparcV8SimpleInstructionSelector(TM));
 
   // Print machine instructions as they were initially generated.