aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCTargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r--lib/Target/PowerPC/PPCTargetMachine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
index 04117d3c05..035c31e7de 100644
--- a/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -55,6 +55,9 @@ bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
PM.add(createLowerConstantExpressionsPass());
+ // Make sure that no unreachable blocks are instruction selected.
+ PM.add(createUnreachableBlockEliminationPass());
+
PM.add(createPPCSimpleInstructionSelector(*this));
if (PrintMachineCode)
@@ -86,6 +89,9 @@ void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
PM.add(createLowerConstantExpressionsPass());
+ // Make sure that no unreachable blocks are instruction selected.
+ PM.add(createUnreachableBlockEliminationPass());
+
PM.add(createPPCSimpleInstructionSelector(TM));
PM.add(createRegisterAllocator());
PM.add(createPrologEpilogCodeInserter());