[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp LiveVariables.cpp MachineInstr.cpp RegisterScavenging.cpp VirtRegMap.cpp

Evan Cheng evan.cheng at apple.com
Thu Apr 26 11:59:57 PDT 2007



Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.238 -> 1.239
LiveVariables.cpp updated: 1.78 -> 1.79
MachineInstr.cpp updated: 1.146 -> 1.147
RegisterScavenging.cpp updated: 1.15 -> 1.16
VirtRegMap.cpp updated: 1.110 -> 1.111
---
Log message:

Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.

---
Diffs of the changes:  (+11 -10)

 LiveIntervalAnalysis.cpp |    2 +-
 LiveVariables.cpp        |    3 ++-
 MachineInstr.cpp         |    4 ++--
 RegisterScavenging.cpp   |    2 +-
 VirtRegMap.cpp           |   10 +++++-----
 5 files changed, 11 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.238 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.239
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.238	Wed Apr 25 02:30:23 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Thu Apr 26 13:59:33 2007
@@ -887,7 +887,7 @@
 
   // If the source instruction was killing the source register before the
   // merge, unset the isKill marker given the live range has been extended.
-  int UIdx = ValLREndInst->findRegisterUseOperand(IntB.reg, true);
+  int UIdx = ValLREndInst->findRegisterUseOperandIdx(IntB.reg, true);
   if (UIdx != -1)
     ValLREndInst->getOperand(UIdx).unsetIsKill();
   


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.78 llvm/lib/CodeGen/LiveVariables.cpp:1.79
--- llvm/lib/CodeGen/LiveVariables.cpp:1.78	Thu Apr 26 03:24:22 2007
+++ llvm/lib/CodeGen/LiveVariables.cpp	Thu Apr 26 13:59:33 2007
@@ -435,7 +435,8 @@
                "Cannot have a live-in virtual register!");
         HandlePhysRegUse(*I, Ret);
         // Add live-out registers as implicit uses.
-        Ret->addRegOperand(*I, false, true);
+        if (Ret->findRegisterUseOperandIdx(*I) == -1)
+          Ret->addRegOperand(*I, false, true);
       }
     }
 


Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.146 llvm/lib/CodeGen/MachineInstr.cpp:1.147
--- llvm/lib/CodeGen/MachineInstr.cpp:1.146	Mon Mar 26 17:37:45 2007
+++ llvm/lib/CodeGen/MachineInstr.cpp	Thu Apr 26 13:59:33 2007
@@ -169,10 +169,10 @@
   }
 }
 
-/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
+/// findRegisterUseOperandIdx() - Returns the MachineOperand that is a use of
 /// the specific register or -1 if it is not found. It further tightening
 /// the search criteria to a use that kills the register if isKill is true.
-int MachineInstr::findRegisterUseOperand(unsigned Reg, bool isKill){
+int MachineInstr::findRegisterUseOperandIdx(unsigned Reg, bool isKill) {
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
     MachineOperand &MO = getOperand(i);
     if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)


Index: llvm/lib/CodeGen/RegisterScavenging.cpp
diff -u llvm/lib/CodeGen/RegisterScavenging.cpp:1.15 llvm/lib/CodeGen/RegisterScavenging.cpp:1.16
--- llvm/lib/CodeGen/RegisterScavenging.cpp:1.15	Tue Apr  3 01:43:29 2007
+++ llvm/lib/CodeGen/RegisterScavenging.cpp	Thu Apr 26 13:59:33 2007
@@ -235,7 +235,7 @@
   I = next(I);
   while (I != MBB->end()) {
     Dist++;
-    if (I->findRegisterUseOperand(Reg) != -1)
+    if (I->findRegisterUseOperandIdx(Reg) != -1)
         return Dist;
     I = next(I);    
   }


Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.110 llvm/lib/CodeGen/VirtRegMap.cpp:1.111
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.110	Wed Apr 25 17:11:48 2007
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Thu Apr 26 13:59:33 2007
@@ -764,7 +764,7 @@
           // necessary.
           bool WasKill = false;
           if (SSMI) {
-            int UIdx = SSMI->findRegisterUseOperand(PhysReg, true);
+            int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true);
             if (UIdx != -1) {
               MachineOperand &MOK = SSMI->getOperand(UIdx);
               WasKill = MOK.isKill();
@@ -849,7 +849,7 @@
         // necessary.
         bool WasKill = false;
         if (SSMI) {
-          int UIdx = SSMI->findRegisterUseOperand(PhysReg, true);
+          int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true);
           if (UIdx != -1) {
             MachineOperand &MOK = SSMI->getOperand(UIdx);
             WasKill = MOK.isKill();
@@ -859,7 +859,7 @@
         MachineInstr *CopyMI = prior(MII);
         if (WasKill) {
           // Transfer kill to the next use.
-          int UIdx = CopyMI->findRegisterUseOperand(PhysReg);
+          int UIdx = CopyMI->findRegisterUseOperandIdx(PhysReg);
           assert(UIdx != -1);
           MachineOperand &MOU = CopyMI->getOperand(UIdx);
           MOU.setIsKill();
@@ -957,7 +957,7 @@
               // extended. Remove its kill.
               bool WasKill = false;
               if (SSMI) {
-                int UIdx = SSMI->findRegisterUseOperand(InReg, true);
+                int UIdx = SSMI->findRegisterUseOperandIdx(InReg, true);
                 if (UIdx != -1) {
                   MachineOperand &MOK = SSMI->getOperand(UIdx);
                   WasKill = MOK.isKill();
@@ -967,7 +967,7 @@
               if (NextMII != MBB.end()) {
                 // If NextMII uses InReg and the use is not a two address
                 // operand, mark it killed.
-                int UIdx = NextMII->findRegisterUseOperand(InReg);
+                int UIdx = NextMII->findRegisterUseOperandIdx(InReg);
                 if (UIdx != -1) {
                   MachineOperand &MOU = NextMII->getOperand(UIdx);
                   if (WasKill) {






More information about the llvm-commits mailing list