diff options
author | Scott Michel <scottm@aero.org> | 2009-02-22 23:36:09 +0000 |
---|---|---|
committer | Scott Michel <scottm@aero.org> | 2009-02-22 23:36:09 +0000 |
commit | 4214a5531cdbe538a358033f1847e55c4436be1b (patch) | |
tree | c2edc202e7449fbc8754f423a73864d5b8c7fd86 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | ca4286295f7db200724cb488a04ad15441a8ba99 (diff) |
Introduce the BuildVectorSDNode class that encapsulates the ISD::BUILD_VECTOR
instruction. The class also consolidates the code for detecting constant
splats that's shared across PowerPC and the CellSPU backends (and might be
useful for other backends.) Also introduces SelectionDAG::getBUID_VECTOR() for
generating new BUILD_VECTOR nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 205b7b9dff..4c73729834 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -533,7 +533,7 @@ static SDValue getCopyFromParts(SelectionDAG &DAG, DebugLoc dl, assert(ValueVT.getVectorElementType() == PartVT && ValueVT.getVectorNumElements() == 1 && "Only trivial scalar-to-vector conversions should get here!"); - return DAG.getNode(ISD::BUILD_VECTOR, dl, ValueVT, Val); + return DAG.getBUILD_VECTOR(ValueVT, dl, Val); } if (PartVT.isInteger() && @@ -935,8 +935,8 @@ SDValue SelectionDAGLowering::getValue(const Value *V) { } // Create a BUILD_VECTOR node. - return NodeMap[V] = DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(), - VT, &Ops[0], Ops.size()); + return NodeMap[V] = DAG.getBUILD_VECTOR(VT, getCurDebugLoc(), + &Ops[0], Ops.size()); } // If this is a static alloca, generate it as the frameindex instead of @@ -2470,9 +2470,8 @@ void SelectionDAGLowering::visitShuffleVector(User &I) { MaskEltVT)); } } - Mask = DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(), - Mask.getValueType(), - &MappedOps[0], MappedOps.size()); + Mask = DAG.getBUILD_VECTOR(Mask.getValueType(), getCurDebugLoc(), + &MappedOps[0], MappedOps.size()); setValue(&I, DAG.getNode(ISD::VECTOR_SHUFFLE, getCurDebugLoc(), VT, Src1, Src2, Mask)); @@ -2570,9 +2569,8 @@ void SelectionDAGLowering::visitShuffleVector(User &I) { } } } - Mask = DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(), - Mask.getValueType(), - &MappedOps[0], MappedOps.size()); + Mask = DAG.getBUILD_VECTOR(Mask.getValueType(), getCurDebugLoc(), + &MappedOps[0], MappedOps.size()); setValue(&I, DAG.getNode(ISD::VECTOR_SHUFFLE, getCurDebugLoc(), VT, Src1, Src2, Mask)); return; @@ -2601,8 +2599,7 @@ void SelectionDAGLowering::visitShuffleVector(User &I) { DAG.getConstant(Idx - SrcNumElts, PtrVT))); } } - setValue(&I, DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(), - VT, &Ops[0], Ops.size())); + setValue(&I, DAG.getBUILD_VECTOR(VT, getCurDebugLoc(), &Ops[0], Ops.size())); } void SelectionDAGLowering::visitInsertValue(InsertValueInst &I) { |