diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-04-11 17:47:30 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-04-11 17:47:30 +0000 |
commit | 9ec3cf2c8a22b7690ea2a18aabb980506313c9b4 (patch) | |
tree | dd9cda4b787c3101b3d0a718a7a44d75c80b7518 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 8334e14efc70684b8a1c5996ba1880aadd6f7c26 (diff) | |
download | bcm5719-llvm-9ec3cf2c8a22b7690ea2a18aabb980506313c9b4.tar.gz bcm5719-llvm-9ec3cf2c8a22b7690ea2a18aabb980506313c9b4.zip |
Move ExtractVectorElements to SelectionDAG.
This seems generally useful, and makes sense to
go along with SplitVector.
llvm-svn: 206041
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e85739688cf..069e0d14ad1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -6511,6 +6511,22 @@ SelectionDAG::SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, return std::make_pair(Lo, Hi); } +void SelectionDAG::ExtractVectorElements(SDValue Op, + SmallVectorImpl<SDValue> &Args, + unsigned Start, unsigned Count) { + EVT VT = Op.getValueType(); + if (Count == 0) + Count = VT.getVectorNumElements(); + + EVT EltVT = VT.getVectorElementType(); + EVT IdxTy = TLI->getVectorIdxTy(); + SDLoc SL(Op); + for (unsigned i = Start, e = Start + Count; i != e; ++i) { + Args.push_back(getNode(ISD::EXTRACT_VECTOR_ELT, SL, EltVT, + Op, getConstant(i, IdxTy))); + } +} + // getAddressSpace - Return the address space this GlobalAddress belongs to. unsigned GlobalAddressSDNode::getAddressSpace() const { return getGlobal()->getType()->getAddressSpace(); |