2012-12-11 21:25:42 +00:00
|
|
|
//===-- SIRegisterInfo.cpp - SI Register Information ---------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
/// \brief SI implementation of the TargetRegisterInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
|
|
#include "SIRegisterInfo.h"
|
|
|
|
#include "AMDGPUTargetMachine.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
SIRegisterInfo::SIRegisterInfo(AMDGPUTargetMachine &tm,
|
|
|
|
const TargetInstrInfo &tii)
|
|
|
|
: AMDGPURegisterInfo(tm, tii),
|
|
|
|
TM(tm),
|
|
|
|
TII(tii)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
|
|
|
BitVector Reserved(getNumRegs());
|
|
|
|
return Reserved;
|
|
|
|
}
|
|
|
|
|
2013-03-26 14:04:02 +00:00
|
|
|
unsigned SIRegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC,
|
|
|
|
MachineFunction &MF) const {
|
|
|
|
return RC->getNumRegs();
|
|
|
|
}
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
const TargetRegisterClass *
|
|
|
|
SIRegisterInfo::getISARegClass(const TargetRegisterClass * rc) const {
|
|
|
|
switch (rc->getID()) {
|
|
|
|
case AMDGPU::GPRF32RegClassID:
|
|
|
|
return &AMDGPU::VReg_32RegClass;
|
|
|
|
default: return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const TargetRegisterClass * SIRegisterInfo::getCFGStructurizerRegClass(
|
|
|
|
MVT VT) const {
|
|
|
|
switch(VT.SimpleTy) {
|
|
|
|
default:
|
|
|
|
case MVT::i32: return &AMDGPU::VReg_32RegClass;
|
|
|
|
}
|
|
|
|
}
|