Cleanup recent addition of DAGTypeLegalizer::SplitVecOp_VSELECT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Holewinski 2012-11-29 19:42:09 +00:00
parent 84fca61ca5
commit db62a883a7

View File

@ -1080,46 +1080,42 @@ SDValue DAGTypeLegalizer::SplitVecOp_VSELECT(SDNode *N, unsigned OpNo) {
SDValue Lo, Hi; SDValue Lo, Hi;
GetSplitVector(N->getOperand(0), Lo, Hi); GetSplitVector(N->getOperand(0), Lo, Hi);
assert(Lo.getValueType() == Hi.getValueType() &&
"Lo and Hi have differing types");;
unsigned LoNumElts = Lo.getValueType().getVectorNumElements(); unsigned LoNumElts = Lo.getValueType().getVectorNumElements();
unsigned HiNumElts = Hi.getValueType().getVectorNumElements(); unsigned HiNumElts = Hi.getValueType().getVectorNumElements();
assert(LoNumElts == HiNumElts && "Asymmetric vector split?"); assert(LoNumElts == HiNumElts && "Asymmetric vector split?");
EVT LoOpVT = EVT::getVectorVT(*DAG.getContext(), LLVMContext &Ctx = *DAG.getContext();
Src0.getValueType().getVectorElementType(), SDValue Zero = DAG.getIntPtrConstant(0);
LoNumElts); SDValue LoElts = DAG.getIntPtrConstant(LoNumElts);
EVT LoMaskVT = EVT::getVectorVT(*DAG.getContext(), EVT Src0VT = Src0.getValueType();
MaskVT.getVectorElementType(), EVT Src0EltTy = Src0VT.getVectorElementType();
LoNumElts); EVT MaskEltTy = MaskVT.getVectorElementType();
EVT HiOpVT = EVT::getVectorVT(*DAG.getContext(),
Src0.getValueType().getVectorElementType(),
HiNumElts);
EVT HiMaskVT = EVT::getVectorVT(*DAG.getContext(),
MaskVT.getVectorElementType(),
HiNumElts);
SDValue LoOp0 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, LoOpVT, Src0, EVT LoOpVT = EVT::getVectorVT(Ctx, Src0EltTy, LoNumElts);
DAG.getIntPtrConstant(0)); EVT LoMaskVT = EVT::getVectorVT(Ctx, MaskEltTy, LoNumElts);
SDValue LoOp1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, LoOpVT, Src1, EVT HiOpVT = EVT::getVectorVT(Ctx, Src0EltTy, HiNumElts);
DAG.getIntPtrConstant(0)); EVT HiMaskVT = EVT::getVectorVT(Ctx, MaskEltTy, HiNumElts);
SDValue HiOp0 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HiOpVT, Src0, SDValue LoOp0 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, LoOpVT, Src0, Zero);
DAG.getIntPtrConstant(LoNumElts)); SDValue LoOp1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, LoOpVT, Src1, Zero);
SDValue HiOp1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HiOpVT, Src1,
DAG.getIntPtrConstant(LoNumElts));
SDValue LoMask = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, LoMaskVT, Mask, SDValue HiOp0 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HiOpVT, Src0, LoElts);
DAG.getIntPtrConstant(0)); SDValue HiOp1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HiOpVT, Src1, LoElts);
SDValue HiMask = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HiMaskVT, Mask,
DAG.getIntPtrConstant(LoNumElts));
SDValue LoSelect = DAG.getNode(ISD::VSELECT, DL, LoOpVT, LoMask, LoOp0, SDValue LoMask =
LoOp1); DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, LoMaskVT, Mask, Zero);
SDValue HiSelect = DAG.getNode(ISD::VSELECT, DL, HiOpVT, HiMask, HiOp0, SDValue HiMask =
HiOp1); DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HiMaskVT, Mask, LoElts);
return DAG.getNode(ISD::CONCAT_VECTORS, DL, Src0.getValueType(), LoSelect, SDValue LoSelect =
HiSelect); DAG.getNode(ISD::VSELECT, DL, LoOpVT, LoMask, LoOp0, LoOp1);
SDValue HiSelect =
DAG.getNode(ISD::VSELECT, DL, HiOpVT, HiMask, HiOp0, HiOp1);
return DAG.getNode(ISD::CONCAT_VECTORS, DL, Src0VT, LoSelect, HiSelect);
} }
SDValue DAGTypeLegalizer::SplitVecOp_UnaryOp(SDNode *N) { SDValue DAGTypeLegalizer::SplitVecOp_UnaryOp(SDNode *N) {