diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-08-13 16:32:45 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-08-13 16:32:45 +0000 |
| commit | 17000682620e0faef30fa680b14ff500c73499d9 (patch) | |
| tree | 24ba6bccb13e4a5869e651561543cb5730ec948a /llvm/lib/CodeGen | |
| parent | 6dec5fe04209be62dfc6c08f6d4b7a363a020f14 (diff) | |
| download | bcm5719-llvm-17000682620e0faef30fa680b14ff500c73499d9.tar.gz bcm5719-llvm-17000682620e0faef30fa680b14ff500c73499d9.zip | |
Always set isDef for operand in position resultPos.
llvm-svn: 357
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 2e3f73fbaa1..85440ae9542 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -46,7 +46,8 @@ MachineInstr::SetMachineOperand(unsigned int i, { assert(i < operands.size()); operands[i].Initialize(operandType, _val); - operands[i].isDef = isdef; + operands[i].isDef = isdef || + TargetInstrDescriptors[opCode].resultPos == (int) i; } void @@ -56,7 +57,8 @@ MachineInstr::SetMachineOperand(unsigned int i, { assert(i < operands.size()); operands[i].InitializeConst(operandType, intValue); - operands[i].isDef = isdef; + operands[i].isDef = isdef || + TargetInstrDescriptors[opCode].resultPos == (int) i; } void @@ -65,7 +67,8 @@ MachineInstr::SetMachineOperand(unsigned int i, { assert(i < operands.size()); operands[i].InitializeReg(regNum); - operands[i].isDef = isdef; + operands[i].isDef = isdef || + TargetInstrDescriptors[opCode].resultPos == (int) i; } void @@ -249,9 +252,9 @@ Set3OperandsFromInstrJUNK(MachineInstr* minstr, // If operand 3 (result) can be discarded, use a dead register if one exists if (canDiscardResult && target.zeroRegNum >= 0) - minstr->SetMachineOperand(resultPosition, target.zeroRegNum, true); + minstr->SetMachineOperand(resultPosition, target.zeroRegNum); else - minstr->SetMachineOperand(resultPosition, MachineOperand::MO_VirtualRegister, vmInstrNode->getValue(), true); + minstr->SetMachineOperand(resultPosition, MachineOperand::MO_VirtualRegister, vmInstrNode->getValue()); return returnFlags; } @@ -281,9 +284,9 @@ Set3OperandsFromInstr(MachineInstr* minstr, // result operand: if it can be discarded, use a dead register if one exists if (canDiscardResult && target.zeroRegNum >= 0) - minstr->SetMachineOperand(resultPosition, target.zeroRegNum, true); + minstr->SetMachineOperand(resultPosition, target.zeroRegNum); else - minstr->SetMachineOperand(resultPosition, MachineOperand::MO_VirtualRegister, vmInstrNode->getValue(), true); + minstr->SetMachineOperand(resultPosition, MachineOperand::MO_VirtualRegister, vmInstrNode->getValue()); } |

