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:
|
2011-07-19 06:37:02 +00:00
|
|
|
PTXTargetMachine(const Target &T, StringRef TT,
|
|
|
|
StringRef CPU, StringRef FS, Reloc::Model RM,
|
2011-06-30 01:53:36 +00:00
|
|
|
bool is64Bit);
|
2010-09-18 18:52:28 +00:00
|
|
|
|
|
|
|
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
|
2011-04-20 15:37:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PTX32TargetMachine : public PTXTargetMachine {
|
|
|
|
public:
|
|
|
|
|
2011-07-19 06:37:02 +00:00
|
|
|
PTX32TargetMachine(const Target &T, StringRef TT,
|
|
|
|
StringRef CPU, StringRef FS, Reloc::Model RM);
|
2011-04-20 15:37:17 +00:00
|
|
|
}; // class PTX32TargetMachine
|
|
|
|
|
|
|
|
class PTX64TargetMachine : public PTXTargetMachine {
|
|
|
|
public:
|
|
|
|
|
2011-07-19 06:37:02 +00:00
|
|
|
PTX64TargetMachine(const Target &T, StringRef TT,
|
|
|
|
StringRef CPU, StringRef FS, Reloc::Model RM);
|
2011-04-20 15:37:17 +00:00
|
|
|
}; // class PTX32TargetMachine
|
|
|
|
|
2010-09-07 18:14:24 +00:00
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif // PTX_TARGET_MACHINE_H
|