[llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h
Evan Cheng
evan.cheng at apple.com
Wed Apr 25 00:25:08 PDT 2007
Changes in directory llvm/include/llvm/Target:
MRegisterInfo.h updated: 1.106 -> 1.107
---
Log message:
Test if a register is sub- or super-register of another.
---
Diffs of the changes: (+16 -0)
MRegisterInfo.h | 16 ++++++++++++++++
1 files changed, 16 insertions(+)
Index: llvm/include/llvm/Target/MRegisterInfo.h
diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.106 llvm/include/llvm/Target/MRegisterInfo.h:1.107
--- llvm/include/llvm/Target/MRegisterInfo.h:1.106 Fri Apr 20 19:54:06 2007
+++ llvm/include/llvm/Target/MRegisterInfo.h Wed Apr 25 02:24:50 2007
@@ -321,6 +321,22 @@
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
More information about the llvm-commits
mailing list