summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-04-15 22:12:16 +0000
committerNate Begeman <natebegeman@mac.com>2005-04-15 22:12:16 +0000
commit779c5cbb44f0a79f27d26aeb14a22f5156da5943 (patch)
tree47e63d732d097b08a9b843752af80d0f2afc0e80 /llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
parente0a9d042e2e1a6827cd9555df58f4fbc276db26d (diff)
downloadbcm5719-llvm-779c5cbb44f0a79f27d26aeb14a22f5156da5943.tar.gz
bcm5719-llvm-779c5cbb44f0a79f27d26aeb14a22f5156da5943.zip
Make pattern isel default for ppc
Add new ppc beta option related to using condition registers Make pattern isel control flag (-enable-pattern-isel) global and tristate 0 == off 1 == on 2 == target default llvm-svn: 21309
Diffstat (limited to 'llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
index 3d27c98e6af..6286735603e 100644
--- a/llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
+++ b/llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
@@ -30,15 +30,18 @@
using namespace llvm;
namespace llvm {
+ bool PPCCRopts;
cl::opt<bool> AIX("aix",
cl::desc("Generate AIX/xcoff instead of Darwin/MachO"),
cl::Hidden);
-
cl::opt<bool> EnablePPCLSR("enable-lsr-for-ppc",
- cl::desc("Enable LSR for PPC (beta option!)"),
+ cl::desc("Enable LSR for PPC (beta)"),
cl::Hidden);
- cl::opt<bool> EnablePatternISel("enable-ppc-pattern-isel", cl::Hidden,
- cl::desc("Enable the pattern isel"));
+ cl::opt<bool, true> EnablePPCCRopts("enable-cc-opts",
+ cl::desc("Enable opts using condition regs (beta)"),
+ cl::location(PPCCRopts),
+ cl::init(false),
+ cl::Hidden);
}
namespace {
@@ -96,12 +99,13 @@ bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
// Make sure that no unreachable blocks are instruction selected.
PM.add(createUnreachableBlockEliminationPass());
+ // Default to pattern ISel
if (LP64)
PM.add(createPPC64ISelPattern(*this));
- else if (EnablePatternISel)
- PM.add(createPPC32ISelPattern(*this));
- else
+ else if (PatternISelTriState == 0)
PM.add(createPPC32ISelSimple(*this));
+ else
+ PM.add(createPPC32ISelPattern(*this));
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(&std::cerr));
@@ -126,6 +130,8 @@ bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
}
void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
+ bool LP64 = (0 != dynamic_cast<PPC64TargetMachine *>(&TM));
+
if (EnablePPCLSR) {
PM.add(createLoopStrengthReducePass());
PM.add(createCFGSimplificationPass());
@@ -145,7 +151,14 @@ void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
// Make sure that no unreachable blocks are instruction selected.
PM.add(createUnreachableBlockEliminationPass());
- PM.add(createPPC32ISelSimple(TM));
+ // Default to pattern ISel
+ if (LP64)
+ PM.add(createPPC64ISelPattern(TM));
+ else if (PatternISelTriState == 0)
+ PM.add(createPPC32ISelSimple(TM));
+ else
+ PM.add(createPPC32ISelPattern(TM));
+
PM.add(createRegisterAllocator());
PM.add(createPrologEpilogCodeInserter());
OpenPOWER on IntegriCloud