diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-02-15 18:07:29 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-02-15 18:07:29 +0000 |
commit | 93cff7fb82c861b3ad99872444ebd301d35f9cce (patch) | |
tree | 903bc91bf6bffaa9d3f2ee9ea56c2cfe8eec1404 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 7c920e611c47d3f741a913ccc3a458471e9e9679 (diff) | |
download | bcm5719-llvm-93cff7fb82c861b3ad99872444ebd301d35f9cce.tar.gz bcm5719-llvm-93cff7fb82c861b3ad99872444ebd301d35f9cce.zip |
[CodeGen] Document and use getConstant's splat-building feature. NFC.
Differential Revision: http://reviews.llvm.org/D17229
llvm-svn: 260901
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8b1b6bbce30..4799221a11f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -6430,10 +6430,8 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { // zext(setcc) -> (and (vsetcc), (1, 1, ...) for vectors. // Only do this before legalize for now. - EVT EltVT = VT.getVectorElementType(); SDLoc DL(N); - SmallVector<SDValue,8> OneOps(VT.getVectorNumElements(), - DAG.getConstant(1, DL, EltVT)); + SDValue VecOnes = DAG.getConstant(1, DL, VT); if (VT.getSizeInBits() == N0VT.getSizeInBits()) // We know that the # elements of the results is the same as the // # elements of the compare (and the # elements of the compare result @@ -6444,8 +6442,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { DAG.getSetCC(DL, VT, N0.getOperand(0), N0.getOperand(1), cast<CondCodeSDNode>(N0.getOperand(2))->get()), - DAG.getNode(ISD::BUILD_VECTOR, DL, VT, - OneOps)); + VecOnes); // If the desired elements are smaller or larger than the source // elements we can use a matching integer vector type and then @@ -6462,7 +6459,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { cast<CondCodeSDNode>(N0.getOperand(2))->get()); return DAG.getNode(ISD::AND, DL, VT, DAG.getSExtOrTrunc(VsetCC, DL, VT), - DAG.getNode(ISD::BUILD_VECTOR, DL, VT, OneOps)); + VecOnes); } // zext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc |