From 1531b6342151762b4f55e2a5c09f093e3e95fd78 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 15 Jan 2003 19:22:38 +0000 Subject: [PATCH] Remove dead code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5298 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../InstrSelection/InstrSelectionSupport.cpp | 67 ------------------- .../InstrSelection/InstrSelectionSupport.cpp | 67 ------------------- 2 files changed, 134 deletions(-) diff --git a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index db9058f3b3e..8cd19adc851 100644 --- a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -302,73 +302,6 @@ GetMemInstArgs(InstructionNode* memInstrNode, : ptrVal; } - -//------------------------------------------------------------------------ -// Function Set2OperandsFromInstr -// Function Set3OperandsFromInstr -// -// For the common case of 2- and 3-operand arithmetic/logical instructions, -// set the m/c instr. operands directly from the VM instruction's operands. -// Check whether the first or second operand is 0 and can use a dedicated "0" -// register. -// Check whether the second operand should use an immediate field or register. -// (First and third operands are never immediates for such instructions.) -// -// Arguments: -// canDiscardResult: Specifies that the result operand can be discarded -// by using the dedicated "0" -// -// op1position, op2position and resultPosition: Specify in which position -// in the machine instruction the 3 operands (arg1, arg2 -// and result) should go. -// -//------------------------------------------------------------------------ - -void -Set2OperandsFromInstr(MachineInstr* minstr, - InstructionNode* vmInstrNode, - const TargetMachine& target, - bool canDiscardResult, - int op1Position, - int resultPosition) -{ - Set3OperandsFromInstr(minstr, vmInstrNode, target, - canDiscardResult, op1Position, - /*op2Position*/ -1, resultPosition); -} - - -void -Set3OperandsFromInstr(MachineInstr* minstr, - InstructionNode* vmInstrNode, - const TargetMachine& target, - bool canDiscardResult, - int op1Position, - int op2Position, - int resultPosition) -{ - assert(op1Position >= 0); - assert(resultPosition >= 0); - - // operand 1 - minstr->SetMachineOperandVal(op1Position, MachineOperand::MO_VirtualRegister, - vmInstrNode->leftChild()->getValue()); - - // operand 2 (if any) - if (op2Position >= 0) - minstr->SetMachineOperandVal(op2Position, MachineOperand::MO_VirtualRegister, - vmInstrNode->rightChild()->getValue()); - - // result operand: if it can be discarded, use a dead register if one exists - if (canDiscardResult && target.getRegInfo().getZeroRegNum() >= 0) - minstr->SetMachineOperandReg(resultPosition, - target.getRegInfo().getZeroRegNum()); - else - minstr->SetMachineOperandVal(resultPosition, - MachineOperand::MO_VirtualRegister, vmInstrNode->getValue()); -} - - MachineOperand::MachineOperandType ChooseRegOrImmed(int64_t intValue, bool isSigned, diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp index db9058f3b3e..8cd19adc851 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp @@ -302,73 +302,6 @@ GetMemInstArgs(InstructionNode* memInstrNode, : ptrVal; } - -//------------------------------------------------------------------------ -// Function Set2OperandsFromInstr -// Function Set3OperandsFromInstr -// -// For the common case of 2- and 3-operand arithmetic/logical instructions, -// set the m/c instr. operands directly from the VM instruction's operands. -// Check whether the first or second operand is 0 and can use a dedicated "0" -// register. -// Check whether the second operand should use an immediate field or register. -// (First and third operands are never immediates for such instructions.) -// -// Arguments: -// canDiscardResult: Specifies that the result operand can be discarded -// by using the dedicated "0" -// -// op1position, op2position and resultPosition: Specify in which position -// in the machine instruction the 3 operands (arg1, arg2 -// and result) should go. -// -//------------------------------------------------------------------------ - -void -Set2OperandsFromInstr(MachineInstr* minstr, - InstructionNode* vmInstrNode, - const TargetMachine& target, - bool canDiscardResult, - int op1Position, - int resultPosition) -{ - Set3OperandsFromInstr(minstr, vmInstrNode, target, - canDiscardResult, op1Position, - /*op2Position*/ -1, resultPosition); -} - - -void -Set3OperandsFromInstr(MachineInstr* minstr, - InstructionNode* vmInstrNode, - const TargetMachine& target, - bool canDiscardResult, - int op1Position, - int op2Position, - int resultPosition) -{ - assert(op1Position >= 0); - assert(resultPosition >= 0); - - // operand 1 - minstr->SetMachineOperandVal(op1Position, MachineOperand::MO_VirtualRegister, - vmInstrNode->leftChild()->getValue()); - - // operand 2 (if any) - if (op2Position >= 0) - minstr->SetMachineOperandVal(op2Position, MachineOperand::MO_VirtualRegister, - vmInstrNode->rightChild()->getValue()); - - // result operand: if it can be discarded, use a dead register if one exists - if (canDiscardResult && target.getRegInfo().getZeroRegNum() >= 0) - minstr->SetMachineOperandReg(resultPosition, - target.getRegInfo().getZeroRegNum()); - else - minstr->SetMachineOperandVal(resultPosition, - MachineOperand::MO_VirtualRegister, vmInstrNode->getValue()); -} - - MachineOperand::MachineOperandType ChooseRegOrImmed(int64_t intValue, bool isSigned,