2010-09-07 18:14:24 +00:00
|
|
|
//===-- PTXTargetMachine.h - Define TargetMachine for PTX -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the PTX specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef PTX_TARGET_MACHINE_H
|
|
|
|
#define PTX_TARGET_MACHINE_H
|
|
|
|
|
2010-09-18 18:52:28 +00:00
|
|
|
#include "PTXISelLowering.h"
|
|
|
|
#include "PTXInstrInfo.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "PTXFrameLowering.h"
|
2010-09-18 18:52:28 +00:00
|
|
|
#include "PTXSubtarget.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-09-07 18:14:24 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2010-09-18 18:52:28 +00:00
|
|
|
class PTXTargetMachine : public LLVMTargetMachine {
|
|
|
|
private:
|
2011-03-02 07:36:48 +00:00
|
|
|
const TargetData DataLayout;
|
2011-03-02 07:58:46 +00:00
|
|
|
PTXSubtarget Subtarget; // has to be initialized before FrameLowering
|
2011-03-02 07:36:48 +00:00
|
|
|
PTXFrameLowering FrameLowering;
|
|
|
|
PTXInstrInfo InstrInfo;
|
2010-09-18 18:52:28 +00:00
|
|
|
PTXTargetLowering TLInfo;
|
|
|
|
|
|
|
|
public:
|
|
|
|
PTXTargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
|
|
|
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const TargetFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
2010-09-18 18:52:28 +00:00
|
|
|
|
|
|
|
virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const TargetRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo(); }
|
|
|
|
|
|
|
|
virtual const PTXTargetLowering *getTargetLowering() const {
|
|
|
|
return &TLInfo; }
|
|
|
|
|
|
|
|
virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
|
|
|
|
|
|
|
virtual bool addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2011-01-01 10:50:37 +00:00
|
|
|
virtual bool addPostRegAlloc(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2010-09-18 18:52:28 +00:00
|
|
|
}; // class PTXTargetMachine
|
2010-09-07 18:14:24 +00:00
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif // PTX_TARGET_MACHINE_H
|