[llvm] r289341 - [X86][SSE] Ensure UNPCK inputs are a consistent value type in LowerHorizontalByteSum

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 10 13:16:46 PST 2016


Author: rksimon
Date: Sat Dec 10 15:16:45 2016
New Revision: 289341

URL: http://llvm.org/viewvc/llvm-project?rev=289341&view=rev
Log:
[X86][SSE] Ensure UNPCK inputs are a consistent value type in LowerHorizontalByteSum

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=289341&r1=289340&r2=289341&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Dec 10 15:16:45 2016
@@ -21917,8 +21917,9 @@ static SDValue LowerHorizontalByteSum(SD
     // two v2i64 vectors which concatenated are the 4 population counts. We can
     // then use PACKUSWB to shrink and concatenate them into a v4i32 again.
     SDValue Zeros = getZeroVector(VT, Subtarget, DAG, DL);
-    SDValue Low = DAG.getNode(X86ISD::UNPCKL, DL, VT, V, Zeros);
-    SDValue High = DAG.getNode(X86ISD::UNPCKH, DL, VT, V, Zeros);
+    SDValue V32 = DAG.getBitcast(VT, V);
+    SDValue Low = DAG.getNode(X86ISD::UNPCKL, DL, VT, V32, Zeros);
+    SDValue High = DAG.getNode(X86ISD::UNPCKH, DL, VT, V32, Zeros);
 
     // Do the horizontal sums into two v2i64s.
     Zeros = getZeroVector(ByteVecVT, Subtarget, DAG, DL);




More information about the llvm-commits mailing list