2005-10-16 05:39:50 +00:00
|
|
|
//===-- PPCTargetMachine.h - Define TargetMachine for PowerPC -----*- C++ -*-=//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-11 00:09:42 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-11 00:09:42 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-17 04:55:41 +00:00
|
|
|
// This file declares the PowerPC specific subclass of TargetMachine.
|
2004-08-11 00:09:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2005-10-16 05:39:50 +00:00
|
|
|
#ifndef PPC_TARGETMACHINE_H
|
|
|
|
#define PPC_TARGETMACHINE_H
|
2004-08-11 00:09:42 +00:00
|
|
|
|
2005-10-14 23:51:18 +00:00
|
|
|
#include "PPCFrameInfo.h"
|
|
|
|
#include "PPCSubtarget.h"
|
2005-10-14 23:53:41 +00:00
|
|
|
#include "PPCJITInfo.h"
|
2005-10-14 23:59:06 +00:00
|
|
|
#include "PPCInstrInfo.h"
|
2006-03-13 23:20:37 +00:00
|
|
|
#include "PPCISelLowering.h"
|
2007-01-24 03:41:36 +00:00
|
|
|
#include "PPCMachOWriterInfo.h"
|
2005-10-14 23:44:05 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-05-12 06:33:49 +00:00
|
|
|
#include "llvm/Target/TargetData.h"
|
2004-08-11 00:09:42 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2005-10-15 21:58:54 +00:00
|
|
|
class PassManager;
|
2005-10-14 23:44:05 +00:00
|
|
|
class GlobalValue;
|
2004-08-11 00:09:42 +00:00
|
|
|
|
2006-06-16 01:37:27 +00:00
|
|
|
/// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
|
|
|
|
///
|
2006-09-04 04:14:57 +00:00
|
|
|
class PPCTargetMachine : public LLVMTargetMachine {
|
2006-06-16 01:37:27 +00:00
|
|
|
PPCSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
PPCInstrInfo InstrInfo;
|
|
|
|
PPCFrameInfo FrameInfo;
|
|
|
|
PPCJITInfo JITInfo;
|
|
|
|
PPCTargetLowering TLInfo;
|
|
|
|
InstrItineraryData InstrItins;
|
2007-01-24 03:41:36 +00:00
|
|
|
PPCMachOWriterInfo MachOWriterInfo;
|
|
|
|
|
2006-09-07 23:39:26 +00:00
|
|
|
protected:
|
|
|
|
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
|
|
|
|
2005-10-14 23:44:05 +00:00
|
|
|
public:
|
2006-06-16 01:37:27 +00:00
|
|
|
PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit);
|
2005-10-16 05:39:50 +00:00
|
|
|
|
|
|
|
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2005-10-14 23:44:05 +00:00
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
2005-10-16 05:39:50 +00:00
|
|
|
virtual TargetJITInfo *getJITInfo() { return &JITInfo; }
|
2006-05-12 21:09:57 +00:00
|
|
|
virtual PPCTargetLowering *getTargetLowering() const {
|
|
|
|
return const_cast<PPCTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2008-02-10 18:45:23 +00:00
|
|
|
virtual const TargetRegisterInfo *getRegisterInfo() const {
|
2004-08-17 04:55:41 +00:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2006-06-16 01:37:27 +00:00
|
|
|
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
virtual const PPCSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2005-11-01 20:06:59 +00:00
|
|
|
virtual const InstrItineraryData getInstrItineraryData() const {
|
|
|
|
return InstrItins;
|
|
|
|
}
|
2007-01-24 03:41:36 +00:00
|
|
|
virtual const PPCMachOWriterInfo *getMachOWriterInfo() const {
|
|
|
|
return &MachOWriterInfo;
|
|
|
|
}
|
2005-11-01 20:06:59 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
2008-03-11 22:29:46 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
|
|
|
|
virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
|
2006-09-04 04:14:57 +00:00
|
|
|
std::ostream &Out);
|
2008-03-11 22:29:46 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast,
|
2007-07-20 21:56:13 +00:00
|
|
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
2008-03-11 22:29:46 +00:00
|
|
|
virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
|
2007-07-20 21:56:13 +00:00
|
|
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
2007-11-19 20:46:23 +00:00
|
|
|
virtual bool getEnableTailMergeDefault() const;
|
2004-08-11 00:09:42 +00:00
|
|
|
};
|
2006-06-16 01:37:27 +00:00
|
|
|
|
|
|
|
/// PPC32TargetMachine - PowerPC 32-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC32TargetMachine : public PPCTargetMachine {
|
|
|
|
public:
|
|
|
|
PPC32TargetMachine(const Module &M, const std::string &FS);
|
2005-10-16 05:39:50 +00:00
|
|
|
|
2006-06-16 01:37:27 +00:00
|
|
|
static unsigned getJITMatchQuality();
|
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
};
|
|
|
|
|
|
|
|
/// PPC64TargetMachine - PowerPC 64-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC64TargetMachine : public PPCTargetMachine {
|
|
|
|
public:
|
|
|
|
PPC64TargetMachine(const Module &M, const std::string &FS);
|
|
|
|
|
|
|
|
static unsigned getJITMatchQuality();
|
|
|
|
static unsigned getModuleMatchQuality(const Module &M);
|
|
|
|
};
|
|
|
|
|
2004-08-11 00:09:42 +00:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|