[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

Evan Cheng evan.cheng at apple.com
Wed Dec 6 00:27:32 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.203 -> 1.204
---
Log message:

Move copyKillDeadInfo out-of-line. Add findRegisterUseOperand().

---
Diffs of the changes:  (+5 -17)

 MachineInstr.h |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.203 llvm/include/llvm/CodeGen/MachineInstr.h:1.204
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.203	Thu Nov 30 01:07:25 2006
+++ llvm/include/llvm/CodeGen/MachineInstr.h	Wed Dec  6 02:27:17 2006
@@ -386,25 +386,13 @@
     delete removeFromParent();
   }
 
+  /// findRegisterUseOperand() - Returns the MachineOperand that is a use of
+  /// the specific register or NULL if it is not found.
+  MachineOperand *findRegisterUseOperand(unsigned Reg);
+  
   /// copyKillDeadInfo - Copies kill / dead operand properties from MI.
   ///
-  void copyKillDeadInfo(const MachineInstr *MI) {
-    for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
-      const MachineOperand &MO = MI->getOperand(i);
-      if (MO.isReg() && (MO.isKill() || MO.isDead())) {
-        for (unsigned j = 0, ee = getNumOperands(); j != ee; ++j) {
-          MachineOperand &MOp = getOperand(j);
-          if (MOp.isIdenticalTo(MO)) {
-            if (MO.isKill())
-              MOp.setIsKill();
-            else
-              MOp.setIsDead();
-            break;
-          }
-        }
-      }
-    }
-  }
+  void copyKillDeadInfo(const MachineInstr *MI);
 
   //
   // Debugging support






More information about the llvm-commits mailing list