diff options
| author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-05-27 17:58:17 +0000 |
|---|---|---|
| committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-05-27 17:58:17 +0000 |
| commit | 346b98011c33cec0b4ab1354ae29b294e1765faa (patch) | |
| tree | 1010a3bf309175871a3e382958e575eda8e559c0 /llvm/lib | |
| parent | 655c2deaf6791d5692dcb5fbe266bdccddb5d4c7 (diff) | |
| download | bcm5719-llvm-346b98011c33cec0b4ab1354ae29b294e1765faa.tar.gz bcm5719-llvm-346b98011c33cec0b4ab1354ae29b294e1765faa.zip | |
[X86] Clarify PSHUFB+blend lowering function name. NFC.
Also guard against v32i8 users.
llvm-svn: 271024
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d4a631673e8..d11cd5221ba 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -9637,11 +9637,13 @@ static SDValue lowerV8I16GeneralSingleInputVectorShuffle( return V; } -/// \brief Helper to form a PSHUFB-based shuffle+blend. -static SDValue lowerVectorShuffleAsPSHUFB(SDLoc DL, MVT VT, SDValue V1, - SDValue V2, ArrayRef<int> Mask, - SelectionDAG &DAG, bool &V1InUse, - bool &V2InUse) { +/// Helper to form a PSHUFB-based shuffle+blend, opportunistically avoiding the +/// blend if only one input is used. +static SDValue +lowerVectorShuffleAsBlendOfPSHUFBs(SDLoc DL, MVT VT, SDValue V1, SDValue V2, + ArrayRef<int> Mask, SelectionDAG &DAG, + bool &V1InUse, bool &V2InUse) { + assert(VT.is128BitVector() && "v32i8 VPSHUFB blend not implemented yet!"); SmallBitVector Zeroable = computeZeroableShuffleElements(Mask, V1, V2); SDValue V1Mask[16]; SDValue V2Mask[16]; @@ -9807,8 +9809,8 @@ static SDValue lowerV8I16VectorShuffle(SDValue Op, SDValue V1, SDValue V2, // can both shuffle and set up the inefficient blend. if (!IsBlendSupported && Subtarget.hasSSSE3()) { bool V1InUse, V2InUse; - return lowerVectorShuffleAsPSHUFB(DL, MVT::v8i16, V1, V2, Mask, DAG, - V1InUse, V2InUse); + return lowerVectorShuffleAsBlendOfPSHUFBs(DL, MVT::v8i16, V1, V2, Mask, DAG, + V1InUse, V2InUse); } // We can always bit-blend if we have to so the fallback strategy is to @@ -10050,8 +10052,8 @@ static SDValue lowerV16I8VectorShuffle(SDValue Op, SDValue V1, SDValue V2, bool V1InUse = false; bool V2InUse = false; - SDValue PSHUFB = lowerVectorShuffleAsPSHUFB(DL, MVT::v16i8, V1, V2, Mask, - DAG, V1InUse, V2InUse); + SDValue PSHUFB = lowerVectorShuffleAsBlendOfPSHUFBs( + DL, MVT::v16i8, V1, V2, Mask, DAG, V1InUse, V2InUse); // If both V1 and V2 are in use and we can use a direct blend or an unpack, // do so. This avoids using them to handle blends-with-zero which is |

