//
//===----------------------------------------------------------------------===//
//
+// Top-level implementation for the PowerPC target.
//
//===----------------------------------------------------------------------===//
#include <iostream>
using namespace llvm;
-static cl::opt<bool> EnablePPCLSR("enable-lsr-for-ppc", cl::Hidden,
- cl::desc("Enable LSR for PPC (beta)"));
-
namespace {
const std::string PPC32ID = "PowerPC/32bit";
CodeGenFileType FileType) {
if (FileType != TargetMachine::AssemblyFile) return true;
- if (EnablePPCLSR) {
- PM.add(createLoopStrengthReducePass());
- PM.add(createVerifierPass());
- PM.add(createCFGSimplificationPass());
- }
+ // Run loop strength reduction before anything else.
+ PM.add(createLoopStrengthReducePass());
+ PM.add(createCFGSimplificationPass());
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
// FIXME: Implement the switch instruction in the instruction selector!
PM.add(createLowerSwitchPass());
- PM.add(createLowerConstantExpressionsPass());
-
// Make sure that no unreachable blocks are instruction selected.
PM.add(createUnreachableBlockEliminationPass());
// Default to pattern ISel
- if (PatternISelTriState == 0)
+ if (PatternISelTriState == 0) {
+ PM.add(createLowerConstantExpressionsPass());
PM.add(createPPC32ISelSimple(*this));
- else
+ } else
PM.add(createPPC32ISelPattern(*this));
if (PrintMachineCode)
// The JIT does not support or need PIC.
PICEnabled = false;
- if (EnablePPCLSR) {
- PM.add(createLoopStrengthReducePass());
- PM.add(createCFGSimplificationPass());
- }
+ // Run loop strength reduction before anything else.
+ PM.add(createLoopStrengthReducePass());
+ PM.add(createCFGSimplificationPass());
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
// FIXME: Implement the switch instruction in the instruction selector!
PM.add(createLowerSwitchPass());
- PM.add(createLowerConstantExpressionsPass());
-
// Make sure that no unreachable blocks are instruction selected.
PM.add(createUnreachableBlockEliminationPass());
// Default to pattern ISel
- if (PatternISelTriState == 0)
+ if (PatternISelTriState == 0) {
+ PM.add(createLowerConstantExpressionsPass());
PM.add(createPPC32ISelSimple(TM));
- else
+ } else {
PM.add(createPPC32ISelPattern(TM));
+ }
PM.add(createRegisterAllocator());
PM.add(createPrologEpilogCodeInserter());