From: Vikram S. Adve Date: Mon, 8 Jul 2002 22:33:45 +0000 (+0000) Subject: Added two more helper functions for instruction creation. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c920dc714da6bd987df060553d7098697b323264;p=oota-llvm.git Added two more helper functions for instruction creation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2819 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index a30192501b5..bb88200172e 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -136,6 +136,27 @@ Create2OperandInstr_SImmed(MachineOpCode opCode, return M; } +inline MachineInstr* +Create2OperandInstr_Reg(MachineOpCode opCode, + Value* argVal1, unsigned int regNum) +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, argVal1); + M->SetMachineOperandReg(1, regNum); + return M; +} + +inline MachineInstr* +Create2OperandInstr_Reg(MachineOpCode opCode, + unsigned int regNum1, unsigned int regNum2) + +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandReg(0, regNum1); + M->SetMachineOperandReg(1, regNum2); + return M; +} + inline MachineInstr* Create3OperandInstr(MachineOpCode opCode, Value* argVal1, MachineOperand::MachineOperandType type1,