MI keeps a ptr of TargetInstrDescriptor, use it.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 7 Dec 2006 01:21:59 +0000 (01:21 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 7 Dec 2006 01:21:59 +0000 (01:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32296 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/VirtRegMap.cpp
lib/Target/X86/X86RegisterInfo.cpp

index 3bdbe855c376163e905c941f2c325ef6e2f14933..eeabbd1c05478e87c028eed69066645aa9219b29 100644 (file)
@@ -434,7 +434,8 @@ static bool isReDefinedByTwoAddr(MachineInstr *MI, unsigned Reg,
       for (unsigned j = i+1; j < e; ++j) {
         MachineOperand &MO2 = MI->getOperand(j);
         if (MO2.isRegister() && MO2.isUse() && MO2.getReg() == Reg &&
-            TII->getOperandConstraint(MI->getOpcode(),j,TOI::TIED_TO) == (int)i)
+            MI->getInstrDescriptor()->
+            getOperandConstraint(j, TOI::TIED_TO) == (int)i)
           return true;
       }
     }
index 60a773b3b03b44061872d504af8dec51bc7cfc8e..186072c01aaee173184c374a314e5530538323ac 100644 (file)
@@ -97,7 +97,8 @@ void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *OldMI,
   }
 
   ModRef MRInfo;
-  if (TII.getOperandConstraint(OldMI->getOpcode(), OpNo, TOI::TIED_TO) != -1) {
+  if (OldMI->getInstrDescriptor()->
+      getOperandConstraint(OpNo, TOI::TIED_TO) != -1) {
     // Folded a two-address operand.
     MRInfo = isModRef;
   } else if (OldMI->getOperand(OpNo).isDef()) {
@@ -591,7 +592,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
         // aren't allowed to modify the reused register.  If none of these cases
         // apply, reuse it.
         bool CanReuse = true;
-        int ti = TII->getOperandConstraint(MI.getOpcode(), i, TOI::TIED_TO);
+        int ti = MI.getInstrDescriptor()->getOperandConstraint(i, TOI::TIED_TO);
         if (ti != -1 &&
             MI.getOperand(ti).isReg() && 
             MI.getOperand(ti).getReg() == VirtReg) {
index 2dcb2bc49a44e0eb7ee7caa1f6f54e615eec637d..86b2563e921e666a82011593d6fd3c412680a3a1 100644 (file)
@@ -27,6 +27,7 @@
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineLocation.h"
 #include "llvm/Target/TargetFrameInfo.h"
+#include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Support/CommandLine.h"
@@ -289,7 +290,7 @@ MachineInstr* X86RegisterInfo::foldMemoryOperand(MachineInstr *MI,
   bool isTwoAddrFold = false;
   unsigned NumOps = TII.getNumOperands(MI->getOpcode());
   bool isTwoAddr = NumOps > 1 &&
-    TII.getOperandConstraint(MI->getOpcode(), 1, TOI::TIED_TO) != -1;
+    MI->getInstrDescriptor()->getOperandConstraint(1, TOI::TIED_TO) != -1;
 
   MachineInstr *NewMI = NULL;
   // Folding a memory location into the two-address part of a two-address