diff options
author | Mon P Wang <wangmp@apple.com> | 2008-11-10 04:46:22 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-11-10 04:46:22 +0000 |
commit | aeb06d246254e4829a49164a11eacced9a43d9d4 (patch) | |
tree | 4b957844db686ae68329005faa6762317429037f /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | a64f463fb90c66406033e3fd1dc912b648bad328 (diff) |
Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f8d92cba79..0b6809b56f 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4997,6 +4997,12 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) { SDValue ShufMask = N->getOperand(2); unsigned NumElts = ShufMask.getNumOperands(); + SDValue N0 = N->getOperand(0); + SDValue N1 = N->getOperand(1); + + assert(N0.getValueType().getVectorNumElements() == NumElts && + "Vector shuffle must be normalized in DAG"); + // If the shuffle mask is an identity operation on the LHS, return the LHS. bool isIdentity = true; for (unsigned i = 0; i != NumElts; ++i) { @@ -5043,8 +5049,6 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) { } } - SDValue N0 = N->getOperand(0); - SDValue N1 = N->getOperand(1); // Normalize unary shuffle so the RHS is undef. if (isUnary && VecNum == 1) std::swap(N0, N1); |