aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/SparcTargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Sparc/SparcTargetMachine.cpp')
-rw-r--r--lib/Target/Sparc/SparcTargetMachine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp
index 344b88b817..ed133489be 100644
--- a/lib/Target/Sparc/SparcTargetMachine.cpp
+++ b/lib/Target/Sparc/SparcTargetMachine.cpp
@@ -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.