diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-08 22:33:45 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-08 22:33:45 +0000 |
commit | c920dc714da6bd987df060553d7098697b323264 (patch) | |
tree | 5483dce6eeea68f9b1fa2e9dac047d959d5a94e8 /include/llvm | |
parent | 08272fbdb2dd227346789d9d9c4243dffe1ea3a6 (diff) | |
download | llvm-c920dc714da6bd987df060553d7098697b323264.tar.gz llvm-c920dc714da6bd987df060553d7098697b323264.tar.bz2 llvm-c920dc714da6bd987df060553d7098697b323264.tar.xz |
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
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/InstrSelectionSupport.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index a30192501b..bb88200172 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -137,6 +137,27 @@ Create2OperandInstr_SImmed(MachineOpCode opCode, } 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, Value* argVal2, MachineOperand::MachineOperandType type2, |