2012-05-04 20:18:50 +00:00
|
|
|
//===- NVPTXRegisterInfo.h - NVPTX Register Information Impl ----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the NVPTX implementation of the TargetRegisterInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_NVPTX_NVPTXREGISTERINFO_H
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
#include "ManagedStringPool.h"
|
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
2014-04-22 02:25:17 +00:00
|
|
|
#include <sstream>
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
#define GET_REGINFO_HEADER
|
|
|
|
#include "NVPTXGenRegisterInfo.inc"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
// Forward Declarations.
|
|
|
|
class TargetInstrInfo;
|
|
|
|
class NVPTXSubtarget;
|
|
|
|
|
|
|
|
class NVPTXRegisterInfo : public NVPTXGenRegisterInfo {
|
|
|
|
private:
|
|
|
|
bool Is64Bit;
|
|
|
|
// Hold Strings that can be free'd all together with NVPTXRegisterInfo
|
2013-03-30 14:29:21 +00:00
|
|
|
ManagedStringPool ManagedStrPool;
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
public:
|
2013-06-19 21:59:00 +00:00
|
|
|
NVPTXRegisterInfo(const NVPTXSubtarget &st);
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------
|
|
|
|
// Pure virtual functions from TargetRegisterInfo
|
|
|
|
//------------------------------------------------------
|
|
|
|
|
|
|
|
// NVPTX callee saved registers
|
2014-04-29 07:57:44 +00:00
|
|
|
const MCPhysReg *
|
|
|
|
getCalleeSavedRegs(const MachineFunction *MF = nullptr) const override;
|
2012-05-04 20:18:50 +00:00
|
|
|
|
2014-04-29 07:57:44 +00:00
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const override;
|
2012-05-04 20:18:50 +00:00
|
|
|
|
2014-04-29 07:57:44 +00:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
|
|
|
|
unsigned FIOperandNum,
|
|
|
|
RegScavenger *RS = nullptr) const override;
|
2012-05-04 20:18:50 +00:00
|
|
|
|
2014-04-29 07:57:44 +00:00
|
|
|
unsigned getFrameRegister(const MachineFunction &MF) const override;
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
ManagedStringPool *getStrPool() const {
|
|
|
|
return const_cast<ManagedStringPool *>(&ManagedStrPool);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *getName(unsigned RegNo) const {
|
|
|
|
std::stringstream O;
|
|
|
|
O << "reg" << RegNo;
|
|
|
|
return getStrPool()->getManagedString(O.str().c_str())->c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2013-03-30 14:29:21 +00:00
|
|
|
std::string getNVPTXRegClassName(const TargetRegisterClass *RC);
|
|
|
|
std::string getNVPTXRegClassStr(const TargetRegisterClass *RC);
|
2012-05-04 20:18:50 +00:00
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|