mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-27 14:07:32 +00:00
Add predicates for checking if a virtual register has a physical
register mapping or a stack slot mapping. llvm-svn: 11795
This commit is contained in:
parent
9f2c8c7ea5
commit
042f01039b
@ -57,6 +57,10 @@ namespace llvm {
|
||||
v2ssMap_(mf.getSSARegMap()->getNumVirtualRegs(), NO_STACK_SLOT) {
|
||||
}
|
||||
|
||||
bool hasPhys(unsigned virtReg) const {
|
||||
return getPhys(virtReg) != NO_PHYS_REG;
|
||||
}
|
||||
|
||||
unsigned getPhys(unsigned virtReg) const {
|
||||
assert(MRegisterInfo::isVirtualRegister(virtReg));
|
||||
return v2pMap_[toIndex(virtReg)];
|
||||
@ -78,6 +82,10 @@ namespace llvm {
|
||||
v2pMap_[toIndex(virtReg)] = NO_PHYS_REG;
|
||||
}
|
||||
|
||||
bool hasStackSlot(unsigned virtReg) const {
|
||||
return getStackSlot(virtReg) != NO_STACK_SLOT;
|
||||
}
|
||||
|
||||
int getStackSlot(unsigned virtReg) const {
|
||||
assert(MRegisterInfo::isVirtualRegister(virtReg));
|
||||
return v2ssMap_[toIndex(virtReg)];
|
||||
|
Loading…
Reference in New Issue
Block a user