Add isSubRegisterEq() and isSuperRegisterEq().
[oota-llvm.git] / include / llvm / MC / MCRegisterInfo.h
index 9310b466f41129207af080eebc883d36b77cd70f..c793533fab6d2f782f98df72286354628d79585d 100644 (file)
@@ -386,14 +386,24 @@ public:
     return RegEncodingTable[RegNo];
   }
 
-  /// Returns true if regB is a sub-register of regA.
-  bool isSubRegister(unsigned regA, unsigned regB) const {
-    return isSuperRegister(regB, regA);
+  /// Returns true if RegB is a sub-register of RegA.
+  bool isSubRegister(unsigned RegA, unsigned RegB) const {
+    return isSuperRegister(RegB, RegA);
   }
 
-  /// Returns true if regB is a super-register of regA.
+  /// Returns true if RegB is a super-register of RegA.
   bool isSuperRegister(unsigned RegA, unsigned RegB) const;
 
+  /// Returns true if RegB is a sub-register of RegA or if RegB == RegA.
+  bool isSubRegisterEq(unsigned RegA, unsigned RegB) const {
+    return isSuperRegisterEq(RegB, RegA);
+  }
+
+  /// Returns true if RegB is a super-register of RegA or if RegB == RegA.
+  bool isSuperRegisterEq(unsigned RegA, unsigned RegB) const {
+    return RegA == RegB || isSuperRegister(RegA, RegB);
+  }
+
 };
 
 //===----------------------------------------------------------------------===//