From 1698c2999c11cbbfa9b0c797047538a087382f62 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 9 Nov 2006 02:22:54 +0000 Subject: Remove M_2_ADDR_FLAG. llvm-svn: 31583 --- llvm/lib/Target/X86/X86RegisterInfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Target/X86/X86RegisterInfo.cpp') diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index aa3ed3089d7..45eae67c949 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -284,14 +284,15 @@ MachineInstr* X86RegisterInfo::foldMemoryOperand(MachineInstr *MI, const TableEntry *OpcodeTablePtr = NULL; unsigned OpcodeTableSize = 0; bool isTwoAddrFold = false; + bool isTwoAddr = TII.getNumOperands(MI->getOpcode()) > 1 && + TII.getOperandConstraint(MI->getOpcode(), 1,TargetInstrInfo::TIED_TO) != -1; // Folding a memory location into the two-address part of a two-address // instruction is different than folding it other places. It requires // replacing the *two* registers with the memory location. - if (MI->getNumOperands() >= 2 && MI->getOperand(0).isReg() && + if (isTwoAddr && MI->getNumOperands() >= 2 && MI->getOperand(0).isReg() && MI->getOperand(1).isReg() && i < 2 && - MI->getOperand(0).getReg() == MI->getOperand(1).getReg() && - TII.isTwoAddrInstr(MI->getOpcode())) { + MI->getOperand(0).getReg() == MI->getOperand(1).getReg()) { static const TableEntry OpcodeTable[] = { { X86::ADC32ri, X86::ADC32mi }, { X86::ADC32ri8, X86::ADC32mi8 }, -- cgit v1.2.3