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"
|
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
|
|
|
|
2005-10-14 23:44:05 +00:00
|
|
|
public:
|
2009-08-02 23:37:13 +00:00
|
|
|
PPCTargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS, bool is64Bit);
|
2005-10-16 05:39:50 +00:00
|
|
|
|
|
|
|
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const PPCFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
|
|
|
virtual PPCJITInfo *getJITInfo() { return &JITInfo; }
|
2006-05-12 21:09:57 +00:00
|
|
|
virtual PPCTargetLowering *getTargetLowering() const {
|
|
|
|
return const_cast<PPCTargetLowering*>(&TLInfo);
|
|
|
|
}
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const PPCRegisterInfo *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;
|
|
|
|
}
|
2008-08-17 13:54:28 +00:00
|
|
|
|
2010-01-18 22:36:35 +00:00
|
|
|
/// getLSDAEncoding - Returns the LSDA pointer encoding. The choices are
|
|
|
|
/// 4-byte, 8-byte, and target default. The CIE is hard-coded to indicate that
|
|
|
|
/// the LSDA pointer in the FDE section is an "sdata4", and should be encoded
|
|
|
|
/// as a 4-byte pointer by default. However, some systems may require a
|
|
|
|
/// different size due to bugs or other conditions. We will default to a
|
|
|
|
/// 4-byte encoding unless the system tells us otherwise.
|
|
|
|
///
|
|
|
|
/// FIXME: This call-back isn't good! We should be using the correct encoding
|
|
|
|
/// regardless of the system. However, there are some systems which have bugs
|
|
|
|
/// that prevent this from occuring.
|
|
|
|
virtual DwarfLSDAEncoding::Encoding getLSDAEncoding() const;
|
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
2009-05-30 20:51:52 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
|
2009-07-15 22:33:19 +00:00
|
|
|
JITCodeEmitter &JCE);
|
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:
|
2009-08-02 23:37:13 +00:00
|
|
|
PPC32TargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
2006-06-16 01:37:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// PPC64TargetMachine - PowerPC 64-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC64TargetMachine : public PPCTargetMachine {
|
|
|
|
public:
|
2009-08-02 23:37:13 +00:00
|
|
|
PPC64TargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
2006-06-16 01:37:27 +00:00
|
|
|
};
|
|
|
|
|
2004-08-11 00:09:42 +00:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|