OSDN Git Service

Don't cache the instruction and register info from the TargetMachine, because
[android-x86/external-llvm.git] / lib / Target / R600 / SIRegisterInfo.cpp
1 //===-- SIRegisterInfo.cpp - SI Register Information ---------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file
11 /// \brief SI implementation of the TargetRegisterInfo class.
12 //
13 //===----------------------------------------------------------------------===//
14
15
16 #include "SIRegisterInfo.h"
17 #include "AMDGPUTargetMachine.h"
18
19 using namespace llvm;
20
21 SIRegisterInfo::SIRegisterInfo(AMDGPUTargetMachine &tm)
22 : AMDGPURegisterInfo(tm),
23   TM(tm)
24   { }
25
26 BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
27   BitVector Reserved(getNumRegs());
28   return Reserved;
29 }
30
31 unsigned SIRegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC,
32                                              MachineFunction &MF) const {
33   return RC->getNumRegs();
34 }
35
36 const TargetRegisterClass *
37 SIRegisterInfo::getISARegClass(const TargetRegisterClass * rc) const {
38   switch (rc->getID()) {
39   case AMDGPU::GPRF32RegClassID:
40     return &AMDGPU::VReg_32RegClass;
41   default: return rc;
42   }
43 }
44
45 const TargetRegisterClass * SIRegisterInfo::getCFGStructurizerRegClass(
46                                                                    MVT VT) const {
47   switch(VT.SimpleTy) {
48     default:
49     case MVT::i32: return &AMDGPU::VReg_32RegClass;
50   }
51 }