2007-12-05 01:24:05 +00:00
|
|
|
//===-- SPUTargetMachine.h - Define TargetMachine for Cell SPU ----*- C++ -*-=//
|
|
|
|
//
|
|
|
|
// 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.
|
2007-12-05 01:24:05 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the CellSPU-specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPU_TARGETMACHINE_H
|
|
|
|
#define SPU_TARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "SPUSubtarget.h"
|
|
|
|
#include "SPUInstrInfo.h"
|
|
|
|
#include "SPUISelLowering.h"
|
2010-05-11 17:31:57 +00:00
|
|
|
#include "SPUSelectionDAGInfo.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "SPUFrameLowering.h"
|
2007-12-05 01:24:05 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class PassManager;
|
|
|
|
class GlobalValue;
|
2011-01-10 12:39:04 +00:00
|
|
|
class TargetFrameLowering;
|
2007-12-05 01:24:05 +00:00
|
|
|
|
|
|
|
/// SPUTargetMachine
|
|
|
|
///
|
|
|
|
class SPUTargetMachine : public LLVMTargetMachine {
|
|
|
|
SPUSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout;
|
|
|
|
SPUInstrInfo InstrInfo;
|
2011-01-10 12:39:04 +00:00
|
|
|
SPUFrameLowering FrameLowering;
|
2007-12-05 01:24:05 +00:00
|
|
|
SPUTargetLowering TLInfo;
|
2010-05-11 17:31:57 +00:00
|
|
|
SPUSelectionDAGInfo TSInfo;
|
2007-12-05 01:24:05 +00:00
|
|
|
InstrItineraryData InstrItins;
|
|
|
|
public:
|
2011-07-19 06:37:02 +00:00
|
|
|
SPUTargetMachine(const Target &T, StringRef TT,
|
2011-07-20 07:51:56 +00:00
|
|
|
StringRef CPU, StringRef FS,
|
|
|
|
Reloc::Model RM, CodeModel::Model CM);
|
2007-12-05 01:24:05 +00:00
|
|
|
|
|
|
|
/// Return the subtarget implementation object
|
|
|
|
virtual const SPUSubtarget *getSubtargetImpl() const {
|
|
|
|
return &Subtarget;
|
|
|
|
}
|
|
|
|
virtual const SPUInstrInfo *getInstrInfo() const {
|
|
|
|
return &InstrInfo;
|
|
|
|
}
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const SPUFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
2007-12-05 01:24:05 +00:00
|
|
|
}
|
|
|
|
/*!
|
|
|
|
\note Cell SPU does not support JIT today. It could support JIT at some
|
|
|
|
point.
|
|
|
|
*/
|
|
|
|
virtual TargetJITInfo *getJITInfo() {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-04-17 15:26:15 +00:00
|
|
|
virtual const SPUTargetLowering *getTargetLowering() const {
|
|
|
|
return &TLInfo;
|
2007-12-05 01:24:05 +00:00
|
|
|
}
|
|
|
|
|
2010-05-11 17:31:57 +00:00
|
|
|
virtual const SPUSelectionDAGInfo* getSelectionDAGInfo() const {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const SPURegisterInfo *getRegisterInfo() const {
|
2007-12-05 01:24:05 +00:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual const TargetData *getTargetData() const {
|
|
|
|
return &DataLayout;
|
|
|
|
}
|
|
|
|
|
2010-09-10 01:29:16 +00:00
|
|
|
virtual const InstrItineraryData *getInstrItineraryData() const {
|
|
|
|
return &InstrItins;
|
2007-12-05 01:24:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2011-01-11 09:07:54 +00:00
|
|
|
virtual bool addPreEmitPass(PassManagerBase &, CodeGenOpt::Level);
|
2007-12-05 01:24:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|