summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86RegisterInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-09 02:22:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-09 02:22:54 +0000
commit1698c2999c11cbbfa9b0c797047538a087382f62 (patch)
treeb66f37fb8755a4cc105e910e4f7a5c2dd29d1eaa /llvm/lib/Target/X86/X86RegisterInfo.cpp
parentc6389c10cc6634bec069fbd84f8213e7aaa8edd9 (diff)
downloadbcm5719-llvm-1698c2999c11cbbfa9b0c797047538a087382f62.tar.gz
bcm5719-llvm-1698c2999c11cbbfa9b0c797047538a087382f62.zip
Remove M_2_ADDR_FLAG.
llvm-svn: 31583
Diffstat (limited to 'llvm/lib/Target/X86/X86RegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86RegisterInfo.cpp7
1 files changed, 4 insertions, 3 deletions
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 },
OpenPOWER on IntegriCloud