[llvm] r218209 - [x86] Explicitly lower to a blend early if it is trivial to do so for

Chandler Carruth chandlerc at gmail.com
Sun Sep 21 04:40:40 PDT 2014


Author: chandlerc
Date: Sun Sep 21 06:40:39 2014
New Revision: 218209

URL: http://llvm.org/viewvc/llvm-project?rev=218209&view=rev
Log:
[x86] Explicitly lower to a blend early if it is trivial to do so for
v8f32 shuffles in the new vector shuffle lowering code.

This is very cheap to do and makes it much more clear that anything more
expensive but overlapping with this lowering should be selected
afterward (for example using AVX2's VPERMPS). However, no functionality
changed here as without this code we would fall through to create no-op
shuffles of each input and a blend. =]

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=218209&r1=218208&r2=218209&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Sep 21 06:40:39 2014
@@ -7238,6 +7238,7 @@ static SDValue lowerVectorShuffleAsBlend
   case MVT::v2f64:
   case MVT::v4f32:
   case MVT::v4f64:
+  case MVT::v8f32:
     return DAG.getNode(X86ISD::BLENDI, DL, VT, V1, V2,
                        DAG.getConstant(BlendMask, MVT::i8));
 
@@ -9319,6 +9320,10 @@ static SDValue lowerV8F32VectorShuffle(S
       isSingleInputShuffleMask(Mask))
     return splitAndLower256BitVectorShuffle(Op, V1, V2, Subtarget, DAG);
 
+  if (SDValue Blend =
+          lowerVectorShuffleAsBlend(DL, MVT::v8f32, V1, V2, Mask, DAG))
+    return Blend;
+
   // Shuffle the input elements into the desired positions in V1 and V2 and
   // blend them together.
   int V1Mask[] = {-1, -1, -1, -1, -1, -1, -1, -1};





More information about the llvm-commits mailing list