summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-04-11 17:47:30 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-04-11 17:47:30 +0000
commit9ec3cf2c8a22b7690ea2a18aabb980506313c9b4 (patch)
treedd9cda4b787c3101b3d0a718a7a44d75c80b7518 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent8334e14efc70684b8a1c5996ba1880aadd6f7c26 (diff)
downloadbcm5719-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.cpp16
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();
OpenPOWER on IntegriCloud