diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-08-11 00:11:25 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-08-11 00:11:25 +0000 |
commit | 0145881cb985b2165bbd1aded733e0183c50e63a (patch) | |
tree | adbd9ed86103208915a91520b1d2dcf5ce64947a /lib/Target/PowerPC/PPCTargetMachine.cpp | |
parent | c0f6420b96d88e67253a20a866236575dccbfd25 (diff) |
Breaking up the PowerPC target into 32- and 64-bit subparts, Part III: the rest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.cpp | 95 |
1 files changed, 14 insertions, 81 deletions
diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 438fd07624..60ddcde57a 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -23,10 +23,12 @@ #include <iostream> using namespace llvm; -namespace { - // Register the target. - RegisterTarget<PowerPCTargetMachine> X("powerpc", " PowerPC (experimental)"); -} +PowerPCTargetMachine::PowerPCTargetMachine(const std::string &name, + IntrinsicLowering *IL, + const TargetData &TD, + const TargetFrameInfo &TFI, + const PowerPCJITInfo &TJI) + : TargetMachine(name, IL, TD), FrameInfo(TFI), JITInfo(TJI) {} unsigned PowerPCTargetMachine::getJITMatchQuality() { #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) @@ -35,86 +37,17 @@ unsigned PowerPCTargetMachine::getJITMatchQuality() { return 0; #endif } - -unsigned PowerPCTargetMachine::getModuleMatchQuality(const Module &M) { - if (M.getEndianness() == Module::BigEndian && - M.getPointerSize() == Module::Pointer32) - return 10; // Direct match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - return getJITMatchQuality()/2; +void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { + assert(0 && "Cannot execute PowerPCJITInfo::addPassesToJITCompile()"); } - -/// PowerPCTargetMachine ctor - Create an ILP32 architecture model -/// -PowerPCTargetMachine::PowerPCTargetMachine(const Module &M, - IntrinsicLowering *IL) - : TargetMachine("PowerPC", IL, false, 4, 4, 4, 4, 4, 4, 2, 1, 4), - FrameInfo(TargetFrameInfo::StackGrowsDown, 16, -4), JITInfo(*this) { +void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) { + assert(0 && "Cannot execute PowerPCJITInfo::replaceMachineCodeForFunction()"); } -/// addPassesToEmitAssembly - Add passes to the specified pass manager -/// to implement a static compiler for this target. -/// -bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM, - std::ostream &Out) { - // FIXME: Implement efficient support for garbage collection intrinsics. - PM.add(createLowerGCPass()); - - // FIXME: Implement the invoke/unwind instructions! - PM.add(createLowerInvokePass()); - - // 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()); - - PM.add(createPPCSimpleInstructionSelector(*this)); - - if (PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); - - PM.add(createRegisterAllocator()); - - if (PrintMachineCode) - PM.add(createMachineFunctionPrinterPass(&std::cerr)); - - // I want a PowerPC specific prolog/epilog code inserter so I can put the - // fills/spills in the right spots. - PM.add(createPowerPCPEI()); - - // Must run branch selection immediately preceding the printer - PM.add(createPPCBranchSelectionPass()); - PM.add(createPPCAsmPrinterPass(Out, *this)); - PM.add(createMachineCodeDeleter()); - return false; -} - -/// addPassesToJITCompile - Add passes to the specified pass manager to -/// implement a fast dynamic compiler for this target. -/// -void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { - // FIXME: Implement efficient support for garbage collection intrinsics. - PM.add(createLowerGCPass()); - - // FIXME: Implement the invoke/unwind instructions! - PM.add(createLowerInvokePass()); - - // 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()); - - PM.add(createPPCSimpleInstructionSelector(TM)); - PM.add(createRegisterAllocator()); - PM.add(createPrologEpilogCodeInserter()); +void *PowerPCJITInfo::getJITStubForFunction(Function *F, + MachineCodeEmitter &MCE) { + assert(0 && "Cannot execute PowerPCJITInfo::getJITStubForFunction()"); + return 0; } |