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 | 149977b48a02735861697d5b4df1fe5a8592245f (patch) | |
tree | 1a6e93d9148356a805811195bd000178bb67ab99 /lib/CodeGen/MachineInstr.cpp | |
parent | b0cdcda42a99b5fb4d99c773006acb175ef391a0 (diff) | |
download | external_llvm-149977b48a02735861697d5b4df1fe5a8592245f.zip external_llvm-149977b48a02735861697d5b4df1fe5a8592245f.tar.gz external_llvm-149977b48a02735861697d5b4df1fe5a8592245f.tar.bz2 |
Always set isDef for operand in position resultPos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 2e3f73f..85440ae 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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()); } |