Fix potential problems with unreachable basic blocks.
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
diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp
index 344b88b..ed13348 100644
--- a/lib/Target/Sparc/SparcTargetMachine.cpp
+++ b/lib/Target/Sparc/SparcTargetMachine.cpp
@@ -56,6 +56,11 @@
// 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 @@
// 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.