[llvm-commits] CVS: llvm/lib/Target/MRegisterInfo.cpp

Evan Cheng evan.cheng at apple.com
Tue Apr 17 13:23:57 PDT 2007



Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.22 -> 1.23
---
Log message:

Change getAllocatableSet() so it returns allocatable registers for a specific register class.

---
Diffs of the changes:  (+7 -4)

 MRegisterInfo.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.22 llvm/lib/Target/MRegisterInfo.cpp:1.23
--- llvm/lib/Target/MRegisterInfo.cpp:1.22	Mon Feb 19 15:49:53 2007
+++ llvm/lib/Target/MRegisterInfo.cpp	Tue Apr 17 15:23:34 2007
@@ -34,13 +34,16 @@
 
 MRegisterInfo::~MRegisterInfo() {}
 
-BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF) const {
+BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF,
+                                           const TargetRegisterClass *RC) const {
   BitVector Allocatable(NumRegs);
   for (MRegisterInfo::regclass_iterator I = regclass_begin(),
          E = regclass_end(); I != E; ++I) {
-    const TargetRegisterClass *RC = *I;
-    for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF),
-           E = RC->allocation_order_end(MF); I != E; ++I)
+    const TargetRegisterClass *TRC = *I;
+    if (RC && TRC != RC)
+      continue;
+    for (TargetRegisterClass::iterator I = TRC->allocation_order_begin(MF),
+           E = TRC->allocation_order_end(MF); I != E; ++I)
       Allocatable.set(*I);
   }
   return Allocatable;






More information about the llvm-commits mailing list