[llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h
Evan Cheng
evan.cheng at apple.com
Thu May 11 00:31:57 PDT 2006
Changes in directory llvm/include/llvm/Target:
MRegisterInfo.h updated: 1.76 -> 1.77
---
Log message:
Also add super- register class info.
---
Diffs of the changes: (+26 -2)
MRegisterInfo.h | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/Target/MRegisterInfo.h
diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.76 llvm/include/llvm/Target/MRegisterInfo.h:1.77
--- llvm/include/llvm/Target/MRegisterInfo.h:1.76 Tue May 9 01:35:30 2006
+++ llvm/include/llvm/Target/MRegisterInfo.h Thu May 11 02:31:44 2006
@@ -49,15 +49,18 @@
typedef const MVT::ValueType* vt_iterator;
typedef const TargetRegisterClass** sc_iterator;
private:
+ bool isSubClass;
const vt_iterator VTs;
const sc_iterator SubClasses;
+ const sc_iterator SuperClasses;
const unsigned RegSize, Alignment; // Size & Alignment of register in bytes
const iterator RegsBegin, RegsEnd;
public:
TargetRegisterClass(const MVT::ValueType *vts,
- const TargetRegisterClass **scs,
+ const TargetRegisterClass **subcs,
+ const TargetRegisterClass **supcs,
unsigned RS, unsigned Al, iterator RB, iterator RE)
- : VTs(vts), SubClasses(scs),
+ : VTs(vts), SubClasses(subcs), SuperClasses(supcs),
RegSize(RS), Alignment(Al), RegsBegin(RB), RegsEnd(RE) {}
virtual ~TargetRegisterClass() {} // Allow subclasses
@@ -124,6 +127,27 @@
return I;
}
+ /// hasSuperRegClass - return true if the specified TargetRegisterClass is a
+ /// super-register class of this TargetRegisterClass.
+ bool hasSuperRegClass(const TargetRegisterClass *cs) const {
+ for (int i = 0; SuperClasses[i] != NULL; ++i)
+ if (SuperClasses[i] == cs)
+ return true;
+ return false;
+ }
+
+ /// superclasses_begin / superclasses_end - Loop over all of the super-classes
+ /// of this register class.
+ sc_iterator superclasses_begin() const {
+ return SuperClasses;
+ }
+
+ sc_iterator superclasses_end() const {
+ sc_iterator I = SuperClasses;
+ while (*I != NULL) ++I;
+ return I;
+ }
+
/// allocation_order_begin/end - These methods define a range of registers
/// which specify the registers in this class that are valid to register
/// allocate, and the preferred order to allocate them in. For example,
More information about the llvm-commits
mailing list