Test if a register is sub- or super-register of another.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-04-25 07:24:50 +00:00
parent cdee1c4272
commit b2f2e64c07

View File

@ -321,6 +321,22 @@ public:
return areAliases(regA, regB);
}
/// isSubRegister - Returns true if regB is a sub-register of regA.
///
bool isSubRegister(unsigned regA, unsigned regB) const {
for (const unsigned *SR = getSubRegisters(regA); *SR; ++SR)
if (*SR == regB) return true;
return false;
}
/// isSuperRegister - Returns true if regB is a super-register of regA.
///
bool isSuperRegister(unsigned regA, unsigned regB) const {
for (const unsigned *SR = getSuperRegisters(regA); *SR; ++SR)
if (*SR == regB) return true;
return false;
}
/// getCalleeSavedRegs - Return a null-terminated list of all of the
/// callee saved registers on this target. The register should be in the
/// order of desired callee-save stack frame offset. The first register is