diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-12-07 01:21:59 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-12-07 01:21:59 +0000 |
commit | 51cdcd197268a7abf19b2698fc824e0da3d98049 (patch) | |
tree | 461fb11bb479ab123fe28c571ad768e15f57c3a4 | |
parent | 6065f66e7c3fbde299a387d8a42c2d3a57d13c38 (diff) | |
download | external_llvm-51cdcd197268a7abf19b2698fc824e0da3d98049.zip external_llvm-51cdcd197268a7abf19b2698fc824e0da3d98049.tar.gz external_llvm-51cdcd197268a7abf19b2698fc824e0da3d98049.tar.bz2 |
MI keeps a ptr of TargetInstrDescriptor, use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32296 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 5 | ||||
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 3bdbe85..eeabbd1 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -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; } } diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 60a773b..186072c 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -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) { diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 2dcb2bc..86b2563 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -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 |