[llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jan 15 13:23:08 PST 2003


Changes in directory llvm/lib/CodeGen/InstrSelection:

InstrSelectionSupport.cpp updated: 1.42 -> 1.43

---
Log message:

Remove dead code


---
Diffs of the changes:

Index: llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
diff -u llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.42 llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.43
--- llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp:1.42	Tue Jan 14 15:58:44 2003
+++ llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp	Wed Jan 15 13:22:38 2003
@@ -302,73 +302,6 @@
                   : 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,





More information about the llvm-commits mailing list