llvm.org GIT mirror llvm / 7256e22
Inline isShuffleMaskLegal into LowerVECTOR_SHUFFLE, so we can start checking each standalone condition and decide whether emit target specific nodes or remove the condition if it's already matched before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113031 91177308-0d34-0410-b5e6-96231b3b80d8 Bruno Cardoso Lopes 9 years ago
1 changed file(s) with 23 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
54745474 if (!isMMX && V2.getOpcode() != ISD::UNDEF && isCommutedSHUFP(SVOp))
54755475 return CommuteVectorShuffle(SVOp, DAG);
54765476
5477 // Check for legal shuffle and return?
5478 SmallVector PermMask;
5479 SVOp->getMask(PermMask);
5480 if (isShuffleMaskLegal(PermMask, VT))
5477 // The checks below are all present in isShuffleMaskLegal, but they are
5478 // inlined here right now to enable us to directly emit target specific
5479 // nodes, and remove one by one until they don't return Op anymore.
5480 SmallVector M;
5481 SVOp->getMask(M);
5482
5483 // Very little shuffling can be done for 64-bit vectors right now.
5484 if (VT.getSizeInBits() == 64)
5485 return isPALIGNRMask(M, VT, Subtarget->hasSSSE3()) ? Op : SDValue();
5486
5487 // FIXME: pshufb, blends, shifts.
5488 if (VT.getVectorNumElements() == 2 ||
5489 ShuffleVectorSDNode::isSplatMask(&M[0], VT) ||
5490 isMOVLMask(M, VT) ||
5491 isSHUFPMask(M, VT) ||
5492 isPSHUFDMask(M, VT) ||
5493 isPSHUFHWMask(M, VT) ||
5494 isPSHUFLWMask(M, VT) ||
5495 isPALIGNRMask(M, VT, Subtarget->hasSSSE3()) ||
5496 isUNPCKLMask(M, VT) ||
5497 isUNPCKHMask(M, VT) ||
5498 isUNPCKL_v_undef_Mask(M, VT) ||
5499 isUNPCKH_v_undef_Mask(M, VT))
54815500 return Op;
54825501
54835502 // Handle v8i16 specifically since SSE can do byte extraction and insertion.