diff options
author | Juergen Ributzka <juergen@apple.com> | 2013-09-21 15:09:46 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2013-09-21 15:09:46 +0000 |
commit | 189c6235e7d783928c94cbfe4bccb39e4bd0b84f (patch) | |
tree | 5ebe6732cb4475cc336d8220726ef1b58ceace00 /lib/CodeGen | |
parent | 95838d5caf2d234156d5862d54f8e78d649a7d1b (diff) | |
download | llvm-189c6235e7d783928c94cbfe4bccb39e4bd0b84f.tar.gz llvm-189c6235e7d783928c94cbfe4bccb39e4bd0b84f.tar.bz2 llvm-189c6235e7d783928c94cbfe4bccb39e4bd0b84f.tar.xz |
Revert "SelectionDAG: Teach the legalizer to split SETCC if VSELECT needs splitting too."
This reverts commit r191130.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 21 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | 22 |
2 files changed, 8 insertions, 35 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 2c0ed3f586..b355cc9a64 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4327,27 +4327,6 @@ SDValue DAGCombiner::visitVSELECT(SDNode *N) { } } - // Treat SETCC as a mask and promote the result type based on the targets - // expected SETCC result type. This will ensure that SETCC and VSELECT are - // both split by the type legalizer. This is done to prevent the type - // legalizer from unrolling SETCC into scalar comparions. - EVT SelectVT = N->getValueType(0); - if (N0.getOpcode() == ISD::SETCC && - N0.getValueType() != getSetCCResultType(SelectVT)) { - SDLoc MaskDL(N0); - EVT MaskVT = getSetCCResultType(SelectVT); - - SDValue Mask = DAG.getNode(ISD::SETCC, MaskDL, MaskVT, N0->getOperand(0), - N0->getOperand(1), N0->getOperand(2)); - - AddToWorkList(Mask.getNode()); - - SDValue LHS = N->getOperand(1); - SDValue RHS = N->getOperand(2); - - return DAG.getNode(ISD::VSELECT, DL, SelectVT, Mask, LHS, RHS); - } - return SDValue(); } diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp index 136d104a4b..d2c26d5507 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp @@ -489,20 +489,14 @@ void DAGTypeLegalizer::SplitRes_SELECT(SDNode *N, SDValue &Lo, SDValue Cond = N->getOperand(0); CL = CH = Cond; if (Cond.getValueType().isVector()) { - if (Cond.getOpcode() == ISD::SETCC) { - assert(Cond.getValueType() == getSetCCResultType(N->getValueType(0)) && - "Condition has not been prepared for split!"); - GetSplitVector(Cond, CL, CH); - } else { - assert(Cond.getValueType().getVectorElementType() == MVT::i1 && - "Condition legalized before result?"); - unsigned NumElements = Cond.getValueType().getVectorNumElements(); - EVT VCondTy = EVT::getVectorVT(*DAG.getContext(), MVT::i1, NumElements / 2); - CL = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VCondTy, Cond, - DAG.getConstant(0, TLI.getVectorIdxTy())); - CH = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VCondTy, Cond, - DAG.getConstant(NumElements / 2, TLI.getVectorIdxTy())); - } + assert(Cond.getValueType().getVectorElementType() == MVT::i1 && + "Condition legalized before result?"); + unsigned NumElements = Cond.getValueType().getVectorNumElements(); + EVT VCondTy = EVT::getVectorVT(*DAG.getContext(), MVT::i1, NumElements / 2); + CL = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VCondTy, Cond, + DAG.getConstant(0, TLI.getVectorIdxTy())); + CH = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VCondTy, Cond, + DAG.getConstant(NumElements / 2, TLI.getVectorIdxTy())); } Lo = DAG.getNode(N->getOpcode(), dl, LL.getValueType(), CL, LL, RL); |