mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-28 00:07:22 +00:00
Remove RegClass2VRegMap from MachineRegisterInfo.
llvm-svn: 133967
This commit is contained in:
parent
190b9d7ec0
commit
f79231cbd4
@ -32,11 +32,6 @@ class MachineRegisterInfo {
|
||||
IndexedMap<std::pair<const TargetRegisterClass*, MachineOperand*>,
|
||||
VirtReg2IndexFunctor> VRegInfo;
|
||||
|
||||
/// RegClassVRegMap - This vector acts as a map from TargetRegisterClass to
|
||||
/// virtual registers. For each target register class, it keeps a list of
|
||||
/// virtual registers belonging to the class.
|
||||
std::vector<unsigned> *RegClass2VRegMap;
|
||||
|
||||
/// RegAllocHints - This vector records register allocation hints for virtual
|
||||
/// registers. For each virtual register, it keeps a register and hint type
|
||||
/// pair making up the allocation hint. Hint type is target specific except
|
||||
@ -216,13 +211,6 @@ public:
|
||||
///
|
||||
unsigned getNumVirtRegs() const { return VRegInfo.size(); }
|
||||
|
||||
/// getRegClassVirtRegs - Return the list of virtual registers of the given
|
||||
/// target register class.
|
||||
const std::vector<unsigned> &
|
||||
getRegClassVirtRegs(const TargetRegisterClass *RC) const {
|
||||
return RegClass2VRegMap[RC->getID()];
|
||||
}
|
||||
|
||||
/// setRegAllocationHint - Specify a register allocation hint for the
|
||||
/// specified virtual register.
|
||||
void setRegAllocationHint(unsigned Reg, unsigned Type, unsigned PrefReg) {
|
||||
|
@ -20,7 +20,6 @@ using namespace llvm;
|
||||
MachineRegisterInfo::MachineRegisterInfo(const TargetRegisterInfo &TRI) {
|
||||
VRegInfo.reserve(256);
|
||||
RegAllocHints.reserve(256);
|
||||
RegClass2VRegMap = new std::vector<unsigned>[TRI.getNumRegClasses()];
|
||||
UsedPhysRegs.resize(TRI.getNumRegs());
|
||||
|
||||
// Create the physreg use/def lists.
|
||||
@ -38,25 +37,13 @@ MachineRegisterInfo::~MachineRegisterInfo() {
|
||||
"PhysRegUseDefLists has entries after all instructions are deleted");
|
||||
#endif
|
||||
delete [] PhysRegUseDefLists;
|
||||
delete [] RegClass2VRegMap;
|
||||
}
|
||||
|
||||
/// setRegClass - Set the register class of the specified virtual register.
|
||||
///
|
||||
void
|
||||
MachineRegisterInfo::setRegClass(unsigned Reg, const TargetRegisterClass *RC) {
|
||||
const TargetRegisterClass *OldRC = VRegInfo[Reg].first;
|
||||
VRegInfo[Reg].first = RC;
|
||||
|
||||
// Remove from old register class's vregs list. This may be slow but
|
||||
// fortunately this operation is rarely needed.
|
||||
std::vector<unsigned> &VRegs = RegClass2VRegMap[OldRC->getID()];
|
||||
std::vector<unsigned>::iterator I =
|
||||
std::find(VRegs.begin(), VRegs.end(), Reg);
|
||||
VRegs.erase(I);
|
||||
|
||||
// Add to new register class's vregs list.
|
||||
RegClass2VRegMap[RC->getID()].push_back(Reg);
|
||||
}
|
||||
|
||||
const TargetRegisterClass *
|
||||
@ -95,7 +82,6 @@ MachineRegisterInfo::createVirtualRegister(const TargetRegisterClass *RegClass){
|
||||
if (ArrayBase && &VRegInfo[FirstVirtReg] != ArrayBase)
|
||||
// The vector reallocated, handle this now.
|
||||
HandleVRegListReallocation();
|
||||
RegClass2VRegMap[RegClass->getID()].push_back(Reg);
|
||||
return Reg;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user