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

2007-04-17 Thread Evan Cheng


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;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-04-17 Thread Chris Lattner
  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 *TRC = *I;
 +if (RC  TRC != RC)
 +  continue;

If RC is specified, you should just scan it, instead of walking  
regclass_begin-end to find it.

-Chris

 +for (TargetRegisterClass::iterator I = TRC- 
 allocation_order_begin(MF),
 +   E = TRC-allocation_order_end(MF); I != E; ++I)
Allocatable.set(*I);
}
return Allocatable;



 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-04-17 Thread Evan Cheng


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.23 - 1.24
---
Log message:

Oops. Didn't mean to check in a quick hack.

---
Diffs of the changes:  (+16 -8)

 MRegisterInfo.cpp |   24 
 1 files changed, 16 insertions(+), 8 deletions(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.23 
llvm/lib/Target/MRegisterInfo.cpp:1.24
--- llvm/lib/Target/MRegisterInfo.cpp:1.23  Tue Apr 17 15:23:34 2007
+++ llvm/lib/Target/MRegisterInfo.cpp   Tue Apr 17 18:33:39 2007
@@ -34,18 +34,26 @@
 
 MRegisterInfo::~MRegisterInfo() {}
 
+/// getAllocatableSetForRC - Toggle the bits that represent allocatable
+/// registers for the specific register class.
+static void getAllocatableSetForRC(MachineFunction MF,
+   const TargetRegisterClass *RC, BitVector 
R){  
+  for (TargetRegisterClass::iterator I = RC-allocation_order_begin(MF),
+ E = RC-allocation_order_end(MF); I != E; ++I)
+R.set(*I);
+}
+
 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 *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);
+  if (RC) {
+getAllocatableSetForRC(MF, RC, Allocatable);
+return Allocatable;
   }
+
+  for (MRegisterInfo::regclass_iterator I = regclass_begin(),
+ E = regclass_end(); I != E; ++I)
+getAllocatableSetForRC(MF, *I, Allocatable);
   return Allocatable;
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-02-19 Thread Evan Cheng


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.21 - 1.22
---
Log message:

Re-apply my liveintervalanalysis changes. Now with PR1207: 
http://llvm.org/PR1207  fixes.

---
Diffs of the changes:  (+1 -1)

 MRegisterInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.21 
llvm/lib/Target/MRegisterInfo.cpp:1.22
--- llvm/lib/Target/MRegisterInfo.cpp:1.21  Sun Feb 18 21:20:00 2007
+++ llvm/lib/Target/MRegisterInfo.cpp   Mon Feb 19 15:49:53 2007
@@ -41,7 +41,7 @@
 const TargetRegisterClass *RC = *I;
 for (TargetRegisterClass::iterator I = RC-allocation_order_begin(MF),
E = RC-allocation_order_end(MF); I != E; ++I)
-  Allocatable[*I] = true;
+  Allocatable.set(*I);
   }
   return Allocatable;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-02-18 Thread Reid Spencer


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.20 - 1.21
---
Log message:

For PR1207: http://llvm.org/PR1207 :
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


---
Diffs of the changes:  (+1 -1)

 MRegisterInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.20 
llvm/lib/Target/MRegisterInfo.cpp:1.21
--- llvm/lib/Target/MRegisterInfo.cpp:1.20  Sat Feb 17 05:06:00 2007
+++ llvm/lib/Target/MRegisterInfo.cpp   Sun Feb 18 21:20:00 2007
@@ -41,7 +41,7 @@
 const TargetRegisterClass *RC = *I;
 for (TargetRegisterClass::iterator I = RC-allocation_order_begin(MF),
E = RC-allocation_order_end(MF); I != E; ++I)
-  Allocatable.set(*I);
+  Allocatable[*I] = true;
   }
   return Allocatable;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-02-17 Thread Evan Cheng


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.19 - 1.20
---
Log message:

Added getReservedRegs().

---
Diffs of the changes:  (+1 -1)

 MRegisterInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.19 
llvm/lib/Target/MRegisterInfo.cpp:1.20
--- llvm/lib/Target/MRegisterInfo.cpp:1.19  Wed Feb 14 23:59:24 2007
+++ llvm/lib/Target/MRegisterInfo.cpp   Sat Feb 17 05:06:00 2007
@@ -41,7 +41,7 @@
 const TargetRegisterClass *RC = *I;
 for (TargetRegisterClass::iterator I = RC-allocation_order_begin(MF),
E = RC-allocation_order_end(MF); I != E; ++I)
-  Allocatable[*I] = true;
+  Allocatable.set(*I);
   }
   return Allocatable;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-02-14 Thread Evan Cheng


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.18 - 1.19
---
Log message:

Use BitVector instead of vectorbool which can be extremely slow.

---
Diffs of the changes:  (+3 -3)

 MRegisterInfo.cpp |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.18 
llvm/lib/Target/MRegisterInfo.cpp:1.19
--- llvm/lib/Target/MRegisterInfo.cpp:1.18  Wed Jan 24 12:45:13 2007
+++ llvm/lib/Target/MRegisterInfo.cpp   Wed Feb 14 23:59:24 2007
@@ -14,10 +14,10 @@
 #include llvm/Target/TargetMachine.h
 #include llvm/Target/MRegisterInfo.h
 #include llvm/Target/TargetFrameInfo.h
-
 #include llvm/CodeGen/MachineFunction.h
 #include llvm/CodeGen/MachineFrameInfo.h
 #include llvm/CodeGen/MachineLocation.h
+#include llvm/ADT/BitVector.h
 
 using namespace llvm;
 
@@ -34,8 +34,8 @@
 
 MRegisterInfo::~MRegisterInfo() {}
 
-std::vectorbool MRegisterInfo::getAllocatableSet(MachineFunction MF) const {
-  std::vectorbool Allocatable(NumRegs);
+BitVector MRegisterInfo::getAllocatableSet(MachineFunction MF) const {
+  BitVector Allocatable(NumRegs);
   for (MRegisterInfo::regclass_iterator I = regclass_begin(),
  E = regclass_end(); I != E; ++I) {
 const TargetRegisterClass *RC = *I;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-01-24 Thread Jim Laskey


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.17 - 1.18
---
Log message:

Repair debug frames as a prelude to eh_frames.  Switched to using MachineMoves
by value so that clean up is less confusing (these vectors tend to be small.)


---
Diffs of the changes:  (+1 -1)

 MRegisterInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.17 
llvm/lib/Target/MRegisterInfo.cpp:1.18
--- llvm/lib/Target/MRegisterInfo.cpp:1.17  Fri Nov 17 15:19:15 2006
+++ llvm/lib/Target/MRegisterInfo.cpp   Wed Jan 24 12:45:13 2007
@@ -64,7 +64,7 @@
 /// getInitialFrameState - Returns a list of machine moves that are assumed
 /// on entry to a function.
 void
-MRegisterInfo::getInitialFrameState(std::vectorMachineMove * Moves) const {
+MRegisterInfo::getInitialFrameState(std::vectorMachineMove Moves) const {
   // Default is to do nothing.
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2006-11-17 Thread Jim Laskey


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.16 - 1.17
---
Log message:

Hopefully a good crack at making debugging work on intel -disable-fp-elim.


---
Diffs of the changes:  (+2 -1)

 MRegisterInfo.cpp |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.16 
llvm/lib/Target/MRegisterInfo.cpp:1.17
--- llvm/lib/Target/MRegisterInfo.cpp:1.16  Thu Aug  3 12:27:09 2006
+++ llvm/lib/Target/MRegisterInfo.cpp   Fri Nov 17 15:19:15 2006
@@ -57,7 +57,8 @@
   ML.set(getFrameRegister(MF),
  MFI-getObjectOffset(Index) +
  MFI-getStackSize() -
- TFI.getOffsetOfLocalArea());
+ TFI.getOffsetOfLocalArea() +
+ MFI-getOffsetAdjustment());
 }
 
 /// getInitialFrameState - Returns a list of machine moves that are assumed



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2006-08-03 Thread Jim Laskey


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.15 - 1.16
---
Log message:

Get darwin intel debugging up and running.


---
Diffs of the changes:  (+6 -1)

 MRegisterInfo.cpp |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.15 
llvm/lib/Target/MRegisterInfo.cpp:1.16
--- llvm/lib/Target/MRegisterInfo.cpp:1.15  Mon Apr 10 18:09:19 2006
+++ llvm/lib/Target/MRegisterInfo.cpp   Thu Aug  3 12:27:09 2006
@@ -11,7 +11,9 @@
 //
 
//===--===//
 
+#include llvm/Target/TargetMachine.h
 #include llvm/Target/MRegisterInfo.h
+#include llvm/Target/TargetFrameInfo.h
 
 #include llvm/CodeGen/MachineFunction.h
 #include llvm/CodeGen/MachineFrameInfo.h
@@ -50,9 +52,12 @@
 /// variables and then call MRegisterInfo::getLocation for the default action.
 void MRegisterInfo::getLocation(MachineFunction MF, unsigned Index,
 MachineLocation ML) const {
+  const TargetFrameInfo TFI = *MF.getTarget().getFrameInfo();
   MachineFrameInfo *MFI = MF.getFrameInfo();
   ML.set(getFrameRegister(MF),
- MFI-getObjectOffset(Index) + MFI-getStackSize());
+ MFI-getObjectOffset(Index) +
+ MFI-getStackSize() -
+ TFI.getOffsetOfLocalArea());
 }
 
 /// getInitialFrameState - Returns a list of machine moves that are assumed



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2006-04-10 Thread Jim Laskey


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.14 - 1.15
---
Log message:

Use existing information.


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

 MRegisterInfo.cpp |7 ---
 1 files changed, 7 deletions(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.14 
llvm/lib/Target/MRegisterInfo.cpp:1.15
--- llvm/lib/Target/MRegisterInfo.cpp:1.14  Fri Apr  7 11:34:45 2006
+++ llvm/lib/Target/MRegisterInfo.cpp   Mon Apr 10 18:09:19 2006
@@ -44,13 +44,6 @@
   return Allocatable;
 }
 
-/// getStackDirection - This method should return the factor by which stacks
-/// grow.  The tyical value is -4 which is the grows negatively in 4 byte
-/// increments.
-int MRegisterInfo::getStackDirection() const {
-  return -sizeof(int32_t);
-}
-
 /// getLocation - This method should return the actual location of a frame
 /// variable given the frame index.  The location is returned in ML.
 /// Subclasses should override this method for special handling of frame



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2006-04-07 Thread Jim Laskey


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.13 - 1.14
---
Log message:

Foundation for call frame information.


---
Diffs of the changes:  (+15 -0)

 MRegisterInfo.cpp |   15 +++
 1 files changed, 15 insertions(+)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.13 
llvm/lib/Target/MRegisterInfo.cpp:1.14
--- llvm/lib/Target/MRegisterInfo.cpp:1.13  Tue Mar 28 07:48:33 2006
+++ llvm/lib/Target/MRegisterInfo.cpp   Fri Apr  7 11:34:45 2006
@@ -44,6 +44,13 @@
   return Allocatable;
 }
 
+/// getStackDirection - This method should return the factor by which stacks
+/// grow.  The tyical value is -4 which is the grows negatively in 4 byte
+/// increments.
+int MRegisterInfo::getStackDirection() const {
+  return -sizeof(int32_t);
+}
+
 /// getLocation - This method should return the actual location of a frame
 /// variable given the frame index.  The location is returned in ML.
 /// Subclasses should override this method for special handling of frame
@@ -54,3 +61,11 @@
   ML.set(getFrameRegister(MF),
  MFI-getObjectOffset(Index) + MFI-getStackSize());
 }
+
+/// getInitialFrameState - Returns a list of machine moves that are assumed
+/// on entry to a function.
+void
+MRegisterInfo::getInitialFrameState(std::vectorMachineMove * Moves) const {
+  // Default is to do nothing.
+}
+



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2006-03-28 Thread Jim Laskey


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.12 - 1.13
---
Log message:

Expose base register for DwarfWriter.  Refactor code accordingly.


---
Diffs of the changes:  (+16 -0)

 MRegisterInfo.cpp |   16 
 1 files changed, 16 insertions(+)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.12 
llvm/lib/Target/MRegisterInfo.cpp:1.13
--- llvm/lib/Target/MRegisterInfo.cpp:1.12  Wed Feb  1 12:10:56 2006
+++ llvm/lib/Target/MRegisterInfo.cpp   Tue Mar 28 07:48:33 2006
@@ -12,6 +12,11 @@
 
//===--===//
 
 #include llvm/Target/MRegisterInfo.h
+
+#include llvm/CodeGen/MachineFunction.h
+#include llvm/CodeGen/MachineFrameInfo.h
+#include llvm/CodeGen/MachineLocation.h
+
 using namespace llvm;
 
 MRegisterInfo::MRegisterInfo(const TargetRegisterDesc *D, unsigned NR,
@@ -38,3 +43,14 @@
   }
   return Allocatable;
 }
+
+/// getLocation - This method should return the actual location of a frame
+/// variable given the frame index.  The location is returned in ML.
+/// Subclasses should override this method for special handling of frame
+/// variables and then call MRegisterInfo::getLocation for the default action.
+void MRegisterInfo::getLocation(MachineFunction MF, unsigned Index,
+MachineLocation ML) const {
+  MachineFrameInfo *MFI = MF.getFrameInfo();
+  ML.set(getFrameRegister(MF),
+ MFI-getObjectOffset(Index) + MFI-getStackSize());
+}



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2006-02-01 Thread Chris Lattner


Changes in directory llvm/lib/Target:

MRegisterInfo.cpp updated: 1.11 - 1.12
---
Log message:

Finegrainify namespacification


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

 MRegisterInfo.cpp |5 +
 1 files changed, 1 insertion(+), 4 deletions(-)


Index: llvm/lib/Target/MRegisterInfo.cpp
diff -u llvm/lib/Target/MRegisterInfo.cpp:1.11 
llvm/lib/Target/MRegisterInfo.cpp:1.12
--- llvm/lib/Target/MRegisterInfo.cpp:1.11  Fri Sep 30 12:48:18 2005
+++ llvm/lib/Target/MRegisterInfo.cpp   Wed Feb  1 12:10:56 2006
@@ -12,8 +12,7 @@
 
//===--===//
 
 #include llvm/Target/MRegisterInfo.h
-
-namespace llvm {
+using namespace llvm;
 
 MRegisterInfo::MRegisterInfo(const TargetRegisterDesc *D, unsigned NR,
  regclass_iterator RCB, regclass_iterator RCE,
@@ -39,5 +38,3 @@
   }
   return Allocatable;
 }
-
-} // End llvm namespace



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits