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"
|
|
|
|
#include "SPUFrameInfo.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class PassManager;
|
|
|
|
class GlobalValue;
|
|
|
|
class TargetFrameInfo;
|
|
|
|
|
|
|
|
/// SPUTargetMachine
|
|
|
|
///
|
|
|
|
class SPUTargetMachine : public LLVMTargetMachine {
|
|
|
|
SPUSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout;
|
|
|
|
SPUInstrInfo InstrInfo;
|
|
|
|
SPUFrameInfo FrameInfo;
|
|
|
|
SPUTargetLowering TLInfo;
|
|
|
|
InstrItineraryData InstrItins;
|
|
|
|
public:
|
2009-08-02 23:37:13 +00:00
|
|
|
SPUTargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
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;
|
|
|
|
}
|
2008-05-14 01:58:56 +00:00
|
|
|
virtual const SPUFrameInfo *getFrameInfo() const {
|
2007-12-05 01:24:05 +00:00
|
|
|
return &FrameInfo;
|
|
|
|
}
|
|
|
|
/*!
|
|
|
|
\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
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2009-06-19 19:36:55 +00:00
|
|
|
virtual const InstrItineraryData getInstrItineraryData() const {
|
2007-12-05 01:24:05 +00:00
|
|
|
return InstrItins;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
2009-04-29 23:29:43 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2007-12-05 01:24:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|