2012-02-18 12:03:15 +00:00
|
|
|
//===-- SPUTargetMachine.h - Define TargetMachine for Cell SPU --*- C++ -*-===//
|
2007-12-05 01:24:05 +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.
|
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 {
|
|
|
|
|
|
|
|
/// 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-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 08:38:26 +00:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
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;
|
|
|
|
}
|
|
|
|
|
2012-02-03 05:12:41 +00:00
|
|
|
virtual const SPUTargetLowering *getTargetLowering() const {
|
2010-04-17 15:26:15 +00:00
|
|
|
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();
|
|
|
|
}
|
2012-02-03 05:12:41 +00:00
|
|
|
|
2007-12-05 01:24:05 +00:00
|
|
|
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
|
|
|
}
|
2012-02-03 05:12:41 +00:00
|
|
|
|
2007-12-05 01:24:05 +00:00
|
|
|
// Pass Pipeline Configuration
|
2012-02-04 02:56:59 +00:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
2007-12-05 01:24:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|