diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index abdfc4afb60..dba4c736b70 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -516,7 +516,7 @@ public: void visitExtractElement(User &I); void visitInsertElement(User &I); - void visitShuffleVector(User &I) { assert(0 && "ShuffleVector not impl!"); } + void visitShuffleVector(User &I); void visitGetElementPtr(User &I); void visitCast(User &I); @@ -1076,6 +1076,18 @@ void SelectionDAGLowering::visitExtractElement(User &I) { TLI.getValueType(I.getType()), InVec, InIdx)); } +void SelectionDAGLowering::visitShuffleVector(User &I) { + SDOperand V1 = getValue(I.getOperand(0)); + SDOperand V2 = getValue(I.getOperand(1)); + SDOperand Mask = getValue(I.getOperand(2)); + + SDOperand Num = *(V1.Val->op_end()-2); + SDOperand Typ = *(V2.Val->op_end()-1); + setValue(&I, DAG.getNode(ISD::VVECTOR_SHUFFLE, MVT::Vector, + V1, V2, Mask, Num, Typ)); +} + + void SelectionDAGLowering::visitGetElementPtr(User &I) { SDOperand N = getValue(I.getOperand(0)); const Type *Ty = I.getOperand(0)->getType(); |

