mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Move JITInfo from PPCTM to PPC32TM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18140 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
942d7b5a68
commit
e4fce6f19c
@ -52,12 +52,11 @@ namespace {
|
||||
PowerPCTargetMachine::PowerPCTargetMachine(const std::string &name,
|
||||
IntrinsicLowering *IL,
|
||||
const TargetData &TD,
|
||||
const PowerPCFrameInfo &TFI,
|
||||
const PowerPCJITInfo &TJI)
|
||||
: TargetMachine(name, IL, TD), FrameInfo(TFI), JITInfo(TJI)
|
||||
const PowerPCFrameInfo &TFI)
|
||||
: TargetMachine(name, IL, TD), FrameInfo(TFI)
|
||||
{}
|
||||
|
||||
unsigned PowerPCTargetMachine::getJITMatchQuality() {
|
||||
unsigned PPC32TargetMachine::getJITMatchQuality() {
|
||||
return 0;
|
||||
#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)
|
||||
return 10;
|
||||
@ -132,6 +131,12 @@ void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
|
||||
PM.add(createPPC32ISelSimple(TM));
|
||||
PM.add(createRegisterAllocator());
|
||||
PM.add(createPrologEpilogCodeInserter());
|
||||
|
||||
// Must run branch selection immediately preceding the asm printer
|
||||
PM.add(createPPCBranchSelectionPass());
|
||||
|
||||
if (PrintMachineCode)
|
||||
PM.add(createMachineFunctionPrinterPass(&std::cerr));
|
||||
}
|
||||
|
||||
void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
|
||||
@ -143,14 +148,14 @@ void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
|
||||
PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL)
|
||||
: PowerPCTargetMachine(PPC32ID, IL,
|
||||
TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,4),
|
||||
PowerPCFrameInfo(*this, false), PPC32JITInfo(*this)) {}
|
||||
PowerPCFrameInfo(*this, false)), JITInfo(*this) {}
|
||||
|
||||
/// PPC64TargetMachine ctor - Create a LP64 architecture model
|
||||
///
|
||||
PPC64TargetMachine::PPC64TargetMachine(const Module &M, IntrinsicLowering *IL)
|
||||
: PowerPCTargetMachine(PPC64ID, IL,
|
||||
TargetData(PPC64ID,false,8,4,4,4,4,4,2,1,4),
|
||||
PowerPCFrameInfo(*this, true), PPC64JITInfo(*this)) {}
|
||||
PowerPCFrameInfo(*this, true)) {}
|
||||
|
||||
unsigned PPC32TargetMachine::getModuleMatchQuality(const Module &M) {
|
||||
if (M.getEndianness() == Module::BigEndian &&
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define POWERPC32_TARGETMACHINE_H
|
||||
|
||||
#include "PowerPCTargetMachine.h"
|
||||
#include "PPC32JITInfo.h"
|
||||
#include "PPC32InstrInfo.h"
|
||||
#include "llvm/PassManager.h"
|
||||
|
||||
@ -24,6 +25,7 @@ class IntrinsicLowering;
|
||||
|
||||
class PPC32TargetMachine : public PowerPCTargetMachine {
|
||||
PPC32InstrInfo InstrInfo;
|
||||
PPC32JITInfo JITInfo;
|
||||
|
||||
public:
|
||||
PPC32TargetMachine(const Module &M, IntrinsicLowering *IL);
|
||||
@ -32,6 +34,12 @@ public:
|
||||
return &InstrInfo.getRegisterInfo();
|
||||
}
|
||||
|
||||
virtual TargetJITInfo *getJITInfo() {
|
||||
return &JITInfo;
|
||||
}
|
||||
|
||||
static unsigned getJITMatchQuality();
|
||||
|
||||
static unsigned getModuleMatchQuality(const Module &M);
|
||||
|
||||
bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
||||
|
Loading…
Reference in New Issue
Block a user