diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-10-08 18:49:46 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-10-08 18:49:46 +0000 |
commit | 2a45a65511f331b63785d34ea642a0d29e9e996c (patch) | |
tree | 40fc7ced6afeb73cc032f712b71afbb98ef33325 /llvm/lib/CodeGen/SelectionDAG | |
parent | 20b2a777650117701d6ad9dac3705066349cbc33 (diff) | |
download | bcm5719-llvm-2a45a65511f331b63785d34ea642a0d29e9e996c.tar.gz bcm5719-llvm-2a45a65511f331b63785d34ea642a0d29e9e996c.zip |
Add a SelectionDAG getTargetInsertSubreg convenience function,
similar to getTargetExtractSubreg.
llvm-svn: 83564
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index f6fed2145d9..8c4421e2359 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4769,6 +4769,17 @@ SelectionDAG::getTargetExtractSubreg(int SRIdx, DebugLoc DL, EVT VT, return SDValue(Subreg, 0); } +/// getTargetInsertSubreg - A convenience function for creating +/// TargetInstrInfo::INSERT_SUBREG nodes. +SDValue +SelectionDAG::getTargetInsertSubreg(int SRIdx, DebugLoc DL, EVT VT, + SDValue Operand, SDValue Subreg) { + SDValue SRIdxVal = getTargetConstant(SRIdx, MVT::i32); + SDNode *Result = getMachineNode(TargetInstrInfo::INSERT_SUBREG, DL, + VT, Operand, Subreg, SRIdxVal); + return SDValue(Result, 0); +} + /// getNodeIfExists - Get the specified node if it's already available, or /// else return NULL. SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList, |