Fix PR10059 and future variations by handling all register subclasses.

Add TargetRegisterInfo::hasSubClassEq and use it to check for compatible
register classes instead of trying to list all register classes in
X86's getLoadStoreRegOpcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132398 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2011-06-01 15:32:10 +00:00
parent bdce3726e2
commit 1f9a09c614
2 changed files with 46 additions and 48 deletions

View File

@@ -182,6 +182,12 @@ public:
return false;
}
/// hasSubClassEq - Returns true if RC is a subclass of or equal to this
/// class.
bool hasSubClassEq(const TargetRegisterClass *RC) const {
return RC == this || hasSubClass(RC);
}
/// subclasses_begin / subclasses_end - Loop over all of the classes
/// that are proper subsets of this register class.
sc_iterator subclasses_begin() const {
@@ -203,6 +209,12 @@ public:
return false;
}
/// hasSuperClassEq - Returns true if RC is a superclass of or equal to this
/// class.
bool hasSuperClassEq(const TargetRegisterClass *RC) const {
return RC == this || hasSuperClass(RC);
}
/// superclasses_begin / superclasses_end - Loop over all of the classes
/// that are proper supersets of this register class.
sc_iterator superclasses_begin() const {