[llvm] 8d59853 - Revert rGf269877dc30777354be8a512e871aba1b1f9fd7a "[X86] canonicalizeShuffleMaskWithHorizOp - fold permute(pack(x,y)) -> pack(shuffle(x,y),undef) iff we only demand the lower elements"
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 06:12:07 PDT 2023
Author: Simon Pilgrim
Date: 2023-07-13T14:11:54+01:00
New Revision: 8d598531b3f5435e51fed47e9de989d209bac426
URL: https://github.com/llvm/llvm-project/commit/8d598531b3f5435e51fed47e9de989d209bac426
DIFF: https://github.com/llvm/llvm-project/commit/8d598531b3f5435e51fed47e9de989d209bac426.diff
LOG: Revert rGf269877dc30777354be8a512e871aba1b1f9fd7a "[X86] canonicalizeShuffleMaskWithHorizOp - fold permute(pack(x,y)) -> pack(shuffle(x,y),undef) iff we only demand the lower elements"
This appears to be causing some infinite loops (and is particularly bad when D152928 is applied).
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-4.ll
llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-7.ll
llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-8.ll
llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-6.ll
llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-8.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 92d1bd1bb02523..0dd9a0e403d27a 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -41023,24 +41023,6 @@ static SDValue canonicalizeShuffleMaskWithHorizOp(
getV4X86ShuffleImm8ForMask(PostMask, DL, DAG));
}
}
- // permute(pack(x,y)) -> pack(shuffle(x,y),undef)
- if (!isHoriz && Ops.size() == 1 && NumLanes == 1 &&
- isUndefInRange(ScaledMask, 2, 2)) {
- int M0 = ScaledMask[0];
- int M1 = ScaledMask[1];
- if (isInRange(M0, 0, 4) && isInRange(M1, 0, 4)) {
- // Use SHUFPD for the permute so this will work on SSE2 targets,
- // shuffle combining and domain handling will simplify this later on.
- unsigned SHUFPDMask = (M0 & 1) | ((M1 & 1) << 1);
- SDValue LHS = DAG.getBitcast(MVT::v2f64, BC[0].getOperand(M0 >= 2));
- SDValue RHS = DAG.getBitcast(MVT::v2f64, BC[0].getOperand(M1 >= 2));
- SDValue Res =
- DAG.getNode(X86ISD::SHUFP, DL, MVT::v2f64, LHS, RHS,
- DAG.getTargetConstant(SHUFPDMask, DL, MVT::i8));
- return DAG.getNode(Opcode0, DL, VT0, DAG.getBitcast(SrcVT, Res),
- DAG.getUNDEF(SrcVT));
- }
- }
}
}
diff --git a/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-4.ll b/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-4.ll
index bb734fe303c3d1..d9950516426438 100644
--- a/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-4.ll
+++ b/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-4.ll
@@ -156,64 +156,64 @@ define void @load_i8_stride4_vf4(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr
define void @load_i8_stride4_vf8(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr %out.vec2, ptr %out.vec3) nounwind {
; SSE-LABEL: load_i8_stride4_vf8:
; SSE: # %bb.0:
-; SSE-NEXT: movdqa (%rdi), %xmm5
-; SSE-NEXT: movdqa 16(%rdi), %xmm1
+; SSE-NEXT: movdqa (%rdi), %xmm1
+; SSE-NEXT: movdqa 16(%rdi), %xmm4
; SSE-NEXT: movdqa {{.*#+}} xmm0 = [255,0,255,0,255,0,255,0]
-; SSE-NEXT: movdqa %xmm1, %xmm2
+; SSE-NEXT: movdqa %xmm4, %xmm2
; SSE-NEXT: pand %xmm0, %xmm2
-; SSE-NEXT: pand %xmm5, %xmm0
+; SSE-NEXT: pand %xmm1, %xmm0
; SSE-NEXT: packuswb %xmm2, %xmm0
; SSE-NEXT: packuswb %xmm0, %xmm0
-; SSE-NEXT: pxor %xmm3, %xmm3
-; SSE-NEXT: movdqa %xmm5, %xmm2
-; SSE-NEXT: punpckhbw {{.*#+}} xmm2 = xmm2[8],xmm3[8],xmm2[9],xmm3[9],xmm2[10],xmm3[10],xmm2[11],xmm3[11],xmm2[12],xmm3[12],xmm2[13],xmm3[13],xmm2[14],xmm3[14],xmm2[15],xmm3[15]
-; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm2[0,2,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm6 = xmm4[1,3,2,3,4,5,6,7]
-; SSE-NEXT: movdqa %xmm5, %xmm4
-; SSE-NEXT: punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1],xmm4[2],xmm3[2],xmm4[3],xmm3[3],xmm4[4],xmm3[4],xmm4[5],xmm3[5],xmm4[6],xmm3[6],xmm4[7],xmm3[7]
-; SSE-NEXT: pshufd {{.*#+}} xmm7 = xmm4[0,2,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm8 = xmm7[1,3,2,3,4,5,6,7]
-; SSE-NEXT: punpckldq {{.*#+}} xmm8 = xmm8[0],xmm6[0],xmm8[1],xmm6[1]
+; SSE-NEXT: pxor %xmm7, %xmm7
+; SSE-NEXT: movdqa %xmm4, %xmm2
+; SSE-NEXT: punpckhbw {{.*#+}} xmm2 = xmm2[8],xmm7[8],xmm2[9],xmm7[9],xmm2[10],xmm7[10],xmm2[11],xmm7[11],xmm2[12],xmm7[12],xmm2[13],xmm7[13],xmm2[14],xmm7[14],xmm2[15],xmm7[15]
+; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,2,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm5 = xmm3[0,1,1,3,4,5,6,7]
+; SSE-NEXT: movdqa %xmm4, %xmm3
+; SSE-NEXT: punpcklbw {{.*#+}} xmm3 = xmm3[0],xmm7[0],xmm3[1],xmm7[1],xmm3[2],xmm7[2],xmm3[3],xmm7[3],xmm3[4],xmm7[4],xmm3[5],xmm7[5],xmm3[6],xmm7[6],xmm3[7],xmm7[7]
+; SSE-NEXT: pshufd {{.*#+}} xmm6 = xmm3[0,2,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm8 = xmm6[0,1,1,3,4,5,6,7]
+; SSE-NEXT: punpckldq {{.*#+}} xmm8 = xmm8[0],xmm5[0],xmm8[1],xmm5[1]
+; SSE-NEXT: movdqa %xmm1, %xmm5
+; SSE-NEXT: punpckhbw {{.*#+}} xmm5 = xmm5[8],xmm7[8],xmm5[9],xmm7[9],xmm5[10],xmm7[10],xmm5[11],xmm7[11],xmm5[12],xmm7[12],xmm5[13],xmm7[13],xmm5[14],xmm7[14],xmm5[15],xmm7[15]
+; SSE-NEXT: pshufd {{.*#+}} xmm6 = xmm5[0,2,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm9 = xmm6[1,3,2,3,4,5,6,7]
; SSE-NEXT: movdqa %xmm1, %xmm6
-; SSE-NEXT: punpckhbw {{.*#+}} xmm6 = xmm6[8],xmm3[8],xmm6[9],xmm3[9],xmm6[10],xmm3[10],xmm6[11],xmm3[11],xmm6[12],xmm3[12],xmm6[13],xmm3[13],xmm6[14],xmm3[14],xmm6[15],xmm3[15]
+; SSE-NEXT: punpcklbw {{.*#+}} xmm6 = xmm6[0],xmm7[0],xmm6[1],xmm7[1],xmm6[2],xmm7[2],xmm6[3],xmm7[3],xmm6[4],xmm7[4],xmm6[5],xmm7[5],xmm6[6],xmm7[6],xmm6[7],xmm7[7]
; SSE-NEXT: pshufd {{.*#+}} xmm7 = xmm6[0,2,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm9 = xmm7[0,1,1,3,4,5,6,7]
-; SSE-NEXT: movdqa %xmm1, %xmm7
-; SSE-NEXT: punpcklbw {{.*#+}} xmm7 = xmm7[0],xmm3[0],xmm7[1],xmm3[1],xmm7[2],xmm3[2],xmm7[3],xmm3[3],xmm7[4],xmm3[4],xmm7[5],xmm3[5],xmm7[6],xmm3[6],xmm7[7],xmm3[7]
-; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm7[0,2,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm3 = xmm3[0,1,1,3,4,5,6,7]
-; SSE-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm9[0],xmm3[1],xmm9[1]
-; SSE-NEXT: movsd {{.*#+}} xmm3 = xmm8[0],xmm3[1]
-; SSE-NEXT: packuswb %xmm3, %xmm3
+; SSE-NEXT: pshuflw {{.*#+}} xmm7 = xmm7[1,3,2,3,4,5,6,7]
+; SSE-NEXT: punpckldq {{.*#+}} xmm7 = xmm7[0],xmm9[0],xmm7[1],xmm9[1]
+; SSE-NEXT: packuswb %xmm8, %xmm7
+; SSE-NEXT: pshufd {{.*#+}} xmm7 = xmm7[0,3,2,3]
; SSE-NEXT: movdqa {{.*#+}} xmm8 = [255,255,255,255,255,255,255,255]
-; SSE-NEXT: pand %xmm8, %xmm5
-; SSE-NEXT: pshuflw {{.*#+}} xmm5 = xmm5[3,1,2,3,4,5,6,7]
-; SSE-NEXT: pshufhw {{.*#+}} xmm5 = xmm5[0,1,2,3,7,5,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm5 = xmm5[0,2,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm5 = xmm5[1,0,3,2,4,5,6,7]
+; SSE-NEXT: pand %xmm8, %xmm4
+; SSE-NEXT: pshuflw {{.*#+}} xmm4 = xmm4[3,1,2,3,4,5,6,7]
+; SSE-NEXT: pshufhw {{.*#+}} xmm4 = xmm4[0,1,2,3,7,5,6,7]
+; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm4[0,1,2,0]
+; SSE-NEXT: pshufhw {{.*#+}} xmm4 = xmm4[0,1,2,3,7,6,5,4]
; SSE-NEXT: pand %xmm8, %xmm1
; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[3,1,2,3,4,5,6,7]
; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,7,5,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,1,2,0]
-; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,7,6,5,4]
-; SSE-NEXT: movsd {{.*#+}} xmm1 = xmm5[0],xmm1[1]
-; SSE-NEXT: packuswb %xmm1, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[1,0,3,2,4,5,6,7]
+; SSE-NEXT: packuswb %xmm4, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,3,2,3]
; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[3,1,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[0,1,3,1,4,5,6,7]
+; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm3[3,1,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm3 = xmm3[0,1,3,1,4,5,6,7]
+; SSE-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm5[3,1,2,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[3,1,2,3,4,5,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm4[3,1,2,3]
+; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm6[3,1,2,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm4 = xmm4[3,1,2,3,4,5,6,7]
; SSE-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
-; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm6[3,1,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[0,1,3,1,4,5,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm5 = xmm7[3,1,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm5 = xmm5[0,1,3,1,4,5,6,7]
-; SSE-NEXT: punpckldq {{.*#+}} xmm5 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
-; SSE-NEXT: movsd {{.*#+}} xmm5 = xmm4[0],xmm5[1]
-; SSE-NEXT: packuswb %xmm5, %xmm5
+; SSE-NEXT: packuswb %xmm3, %xmm4
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm4[0,3,2,3]
; SSE-NEXT: movq %xmm0, (%rsi)
-; SSE-NEXT: movq %xmm3, (%rdx)
+; SSE-NEXT: movq %xmm7, (%rdx)
; SSE-NEXT: movq %xmm1, (%rcx)
-; SSE-NEXT: movq %xmm5, (%r8)
+; SSE-NEXT: movq %xmm2, (%r8)
; SSE-NEXT: retq
;
; AVX1-ONLY-LABEL: load_i8_stride4_vf8:
diff --git a/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-7.ll b/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-7.ll
index 6582d671735e4b..0cd7ba03c66cda 100644
--- a/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-7.ll
+++ b/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-7.ll
@@ -446,38 +446,38 @@ define void @load_i8_stride7_vf8(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr
; SSE-NEXT: movdqa %xmm11, %xmm5
; SSE-NEXT: pandn %xmm8, %xmm5
; SSE-NEXT: por %xmm7, %xmm5
-; SSE-NEXT: movdqa {{.*#+}} xmm8 = [65535,65535,65535,0,65535,65535,0,65535]
-; SSE-NEXT: movdqa %xmm8, %xmm7
+; SSE-NEXT: movdqa {{.*#+}} xmm7 = [65535,65535,65535,0,65535,65535,0,65535]
+; SSE-NEXT: movdqa %xmm7, %xmm8
; SSE-NEXT: movdqa %xmm2, %xmm4
-; SSE-NEXT: pandn %xmm2, %xmm7
+; SSE-NEXT: pandn %xmm2, %xmm8
; SSE-NEXT: movdqa %xmm1, %xmm3
-; SSE-NEXT: pand %xmm8, %xmm1
-; SSE-NEXT: por %xmm7, %xmm1
-; SSE-NEXT: movdqa %xmm1, %xmm7
-; SSE-NEXT: punpcklbw {{.*#+}} xmm7 = xmm7[0],xmm13[0],xmm7[1],xmm13[1],xmm7[2],xmm13[2],xmm7[3],xmm13[3],xmm7[4],xmm13[4],xmm7[5],xmm13[5],xmm7[6],xmm13[6],xmm7[7],xmm13[7]
+; SSE-NEXT: pand %xmm7, %xmm1
+; SSE-NEXT: por %xmm8, %xmm1
+; SSE-NEXT: movdqa %xmm1, %xmm8
+; SSE-NEXT: punpcklbw {{.*#+}} xmm8 = xmm8[0],xmm13[0],xmm8[1],xmm13[1],xmm8[2],xmm13[2],xmm8[3],xmm13[3],xmm8[4],xmm13[4],xmm8[5],xmm13[5],xmm8[6],xmm13[6],xmm8[7],xmm13[7]
; SSE-NEXT: movdqa {{.*#+}} xmm0 = [65535,0,65535,65535,65535,65535,0,65535]
; SSE-NEXT: movdqa %xmm0, %xmm2
-; SSE-NEXT: pandn %xmm7, %xmm2
+; SSE-NEXT: pandn %xmm8, %xmm2
; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm13[8],xmm1[9],xmm13[9],xmm1[10],xmm13[10],xmm1[11],xmm13[11],xmm1[12],xmm13[12],xmm1[13],xmm13[13],xmm1[14],xmm13[14],xmm1[15],xmm13[15]
; SSE-NEXT: pand %xmm0, %xmm1
; SSE-NEXT: por %xmm2, %xmm1
; SSE-NEXT: punpcklbw {{.*#+}} xmm9 = xmm9[0],xmm13[0],xmm9[1],xmm13[1],xmm9[2],xmm13[2],xmm9[3],xmm13[3],xmm9[4],xmm13[4],xmm9[5],xmm13[5],xmm9[6],xmm13[6],xmm9[7],xmm13[7]
; SSE-NEXT: movdqa {{.*#+}} xmm2 = [65535,65535,65535,0,65535,65535,65535,65535]
-; SSE-NEXT: movdqa %xmm9, %xmm7
-; SSE-NEXT: pand %xmm2, %xmm7
+; SSE-NEXT: movdqa %xmm9, %xmm8
+; SSE-NEXT: pand %xmm2, %xmm8
; SSE-NEXT: pandn %xmm15, %xmm2
-; SSE-NEXT: por %xmm7, %xmm2
+; SSE-NEXT: por %xmm8, %xmm2
; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,1,2,1]
; SSE-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,4,4,7,6]
; SSE-NEXT: packuswb %xmm2, %xmm2
-; SSE-NEXT: movdqa %xmm11, %xmm7
-; SSE-NEXT: pandn %xmm2, %xmm7
+; SSE-NEXT: movdqa %xmm11, %xmm8
+; SSE-NEXT: pandn %xmm2, %xmm8
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,3,2,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[1,0,3,2,4,5,6,7]
; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,5,5,5,5]
; SSE-NEXT: packuswb %xmm1, %xmm1
; SSE-NEXT: pand %xmm11, %xmm1
-; SSE-NEXT: por %xmm1, %xmm7
+; SSE-NEXT: por %xmm1, %xmm8
; SSE-NEXT: movdqa %xmm3, %xmm2
; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
; SSE-NEXT: pandn %xmm3, %xmm1
@@ -551,38 +551,38 @@ define void @load_i8_stride7_vf8(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr
; SSE-NEXT: pand %xmm2, %xmm1
; SSE-NEXT: pandn %xmm15, %xmm2
; SSE-NEXT: por %xmm1, %xmm2
-; SSE-NEXT: movsd {{.*#+}} xmm2 = xmm0[0],xmm2[1]
-; SSE-NEXT: packuswb %xmm2, %xmm2
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm10[1,3,2,3]
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm4[0,2,2,3]
-; SSE-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
-; SSE-NEXT: movdqa %xmm1, %xmm0
-; SSE-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8],xmm13[8],xmm0[9],xmm13[9],xmm0[10],xmm13[10],xmm0[11],xmm13[11],xmm0[12],xmm13[12],xmm0[13],xmm13[13],xmm0[14],xmm13[14],xmm0[15],xmm13[15]
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,1,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
-; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm13[0],xmm1[1],xmm13[1],xmm1[2],xmm13[2],xmm1[3],xmm13[3],xmm1[4],xmm13[4],xmm1[5],xmm13[5],xmm1[6],xmm13[6],xmm1[7],xmm13[7]
+; SSE-NEXT: packuswb %xmm2, %xmm0
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,3,2,3]
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm10[1,3,2,3]
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm4[0,2,2,3]
+; SSE-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; SSE-NEXT: movdqa %xmm2, %xmm1
+; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm13[8],xmm1[9],xmm13[9],xmm1[10],xmm13[10],xmm1[11],xmm13[11],xmm1[12],xmm13[12],xmm1[13],xmm13[13],xmm1[14],xmm13[14],xmm1[15],xmm13[15]
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,1,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[1,3,2,3,4,5,6,7]
-; SSE-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
-; SSE-NEXT: movdqa {{.*#+}} xmm0 = [0,65535,65535,65535,65535,65535,65535,0]
+; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,2,2,3,4,5,6,7]
+; SSE-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm13[0],xmm2[1],xmm13[1],xmm2[2],xmm13[2],xmm2[3],xmm13[3],xmm2[4],xmm13[4],xmm2[5],xmm13[5],xmm2[6],xmm13[6],xmm2[7],xmm13[7]
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[2,1,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[1,3,2,3,4,5,6,7]
+; SSE-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
+; SSE-NEXT: movdqa {{.*#+}} xmm1 = [0,65535,65535,65535,65535,65535,65535,0]
; SSE-NEXT: punpcklbw {{.*#+}} xmm14 = xmm14[0],xmm13[0],xmm14[1],xmm13[1],xmm14[2],xmm13[2],xmm14[3],xmm13[3],xmm14[4],xmm13[4],xmm14[5],xmm13[5],xmm14[6],xmm13[6],xmm14[7],xmm13[7]
-; SSE-NEXT: pand %xmm0, %xmm14
-; SSE-NEXT: pandn %xmm15, %xmm0
-; SSE-NEXT: por %xmm14, %xmm0
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,3]
-; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,5,4,7,6]
-; SSE-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
-; SSE-NEXT: packuswb %xmm0, %xmm0
-; SSE-NEXT: pand %xmm8, %xmm4
-; SSE-NEXT: pandn %xmm10, %xmm8
-; SSE-NEXT: por %xmm4, %xmm8
-; SSE-NEXT: movdqa %xmm8, %xmm1
-; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm13[0],xmm1[1],xmm13[1],xmm1[2],xmm13[2],xmm1[3],xmm13[3],xmm1[4],xmm13[4],xmm1[5],xmm13[5],xmm1[6],xmm13[6],xmm1[7],xmm13[7]
-; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,6,4,6,7]
-; SSE-NEXT: punpckhbw {{.*#+}} xmm8 = xmm8[8],xmm13[8],xmm8[9],xmm13[9],xmm8[10],xmm13[10],xmm8[11],xmm13[11],xmm8[12],xmm13[12],xmm8[13],xmm13[13],xmm8[14],xmm13[14],xmm8[15],xmm13[15]
-; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm8[0,1,2,1]
-; SSE-NEXT: pshufhw {{.*#+}} xmm8 = xmm8[0,1,2,3,5,7,6,7]
-; SSE-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm8[4],xmm1[5],xmm8[5],xmm1[6],xmm8[6],xmm1[7],xmm8[7]
+; SSE-NEXT: pand %xmm1, %xmm14
+; SSE-NEXT: pandn %xmm15, %xmm1
+; SSE-NEXT: por %xmm14, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,1,0,3]
+; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,5,4,7,6]
+; SSE-NEXT: packuswb %xmm1, %xmm2
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,3,2,3]
+; SSE-NEXT: pand %xmm7, %xmm4
+; SSE-NEXT: pandn %xmm10, %xmm7
+; SSE-NEXT: por %xmm4, %xmm7
+; SSE-NEXT: movdqa %xmm7, %xmm2
+; SSE-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm13[0],xmm2[1],xmm13[1],xmm2[2],xmm13[2],xmm2[3],xmm13[3],xmm2[4],xmm13[4],xmm2[5],xmm13[5],xmm2[6],xmm13[6],xmm2[7],xmm13[7]
+; SSE-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,6,4,6,7]
+; SSE-NEXT: punpckhbw {{.*#+}} xmm7 = xmm7[8],xmm13[8],xmm7[9],xmm13[9],xmm7[10],xmm13[10],xmm7[11],xmm13[11],xmm7[12],xmm13[12],xmm7[13],xmm13[13],xmm7[14],xmm13[14],xmm7[15],xmm13[15]
+; SSE-NEXT: pshufd {{.*#+}} xmm7 = xmm7[0,1,2,1]
+; SSE-NEXT: pshufhw {{.*#+}} xmm7 = xmm7[0,1,2,3,5,7,6,7]
+; SSE-NEXT: punpckhwd {{.*#+}} xmm2 = xmm2[4],xmm7[4],xmm2[5],xmm7[5],xmm2[6],xmm7[6],xmm2[7],xmm7[7]
; SSE-NEXT: por {{[-0-9]+}}(%r{{[sb]}}p), %xmm6 # 16-byte Folded Reload
; SSE-NEXT: punpcklbw {{.*#+}} xmm6 = xmm6[0],xmm13[0],xmm6[1],xmm13[1],xmm6[2],xmm13[2],xmm6[3],xmm13[3],xmm6[4],xmm13[4],xmm6[5],xmm13[5],xmm6[6],xmm13[6],xmm6[7],xmm13[7]
; SSE-NEXT: movdqa {{.*#+}} xmm3 = [65535,0,65535,65535,65535,65535,65535,65535]
@@ -593,15 +593,15 @@ define void @load_i8_stride7_vf8(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr
; SSE-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,4,7,6,7]
; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm3[0,1,2,0]
; SSE-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,4,7,6,5]
-; SSE-NEXT: movsd {{.*#+}} xmm3 = xmm1[0],xmm3[1]
-; SSE-NEXT: packuswb %xmm3, %xmm3
+; SSE-NEXT: packuswb %xmm3, %xmm2
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,3,2,3]
; SSE-NEXT: movq %xmm5, (%rsi)
-; SSE-NEXT: movq %xmm7, (%rdx)
+; SSE-NEXT: movq %xmm8, (%rdx)
; SSE-NEXT: movq %xmm9, (%rcx)
; SSE-NEXT: movq %xmm11, (%r8)
-; SSE-NEXT: movq %xmm2, (%r9)
-; SSE-NEXT: movq %xmm0, (%rdi)
-; SSE-NEXT: movq %xmm3, (%rax)
+; SSE-NEXT: movq %xmm0, (%r9)
+; SSE-NEXT: movq %xmm1, (%rdi)
+; SSE-NEXT: movq %xmm2, (%rax)
; SSE-NEXT: retq
;
; AVX1-ONLY-LABEL: load_i8_stride7_vf8:
diff --git a/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-8.ll b/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-8.ll
index 629b8b512eee3a..9c6b03d69af651 100644
--- a/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-8.ll
+++ b/llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-8.ll
@@ -379,74 +379,78 @@ define void @load_i8_stride8_vf4(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr
define void @load_i8_stride8_vf8(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr %out.vec2, ptr %out.vec3, ptr %out.vec4, ptr %out.vec5, ptr %out.vec6, ptr %out.vec7) nounwind {
; SSE-LABEL: load_i8_stride8_vf8:
; SSE: # %bb.0:
-; SSE-NEXT: subq $24, %rsp
+; SSE-NEXT: pushq %rax
; SSE-NEXT: movdqa (%rdi), %xmm12
-; SSE-NEXT: movdqa 16(%rdi), %xmm11
-; SSE-NEXT: movdqa 32(%rdi), %xmm14
+; SSE-NEXT: movdqa 16(%rdi), %xmm14
+; SSE-NEXT: movdqa 32(%rdi), %xmm9
; SSE-NEXT: movdqa 48(%rdi), %xmm10
-; SSE-NEXT: movdqa {{.*#+}} xmm7 = [255,0,0,0,255,0,0,0]
-; SSE-NEXT: movdqa %xmm10, %xmm1
-; SSE-NEXT: pand %xmm7, %xmm1
-; SSE-NEXT: movdqa %xmm14, %xmm2
-; SSE-NEXT: pand %xmm7, %xmm2
+; SSE-NEXT: movdqa {{.*#+}} xmm0 = [255,0,0,0,255,0,0,0]
+; SSE-NEXT: movdqa %xmm14, %xmm1
+; SSE-NEXT: pand %xmm0, %xmm1
+; SSE-NEXT: movdqa %xmm12, %xmm2
+; SSE-NEXT: pand %xmm0, %xmm2
; SSE-NEXT: packuswb %xmm1, %xmm2
-; SSE-NEXT: movdqa %xmm11, %xmm1
-; SSE-NEXT: pand %xmm7, %xmm1
-; SSE-NEXT: pand %xmm12, %xmm7
-; SSE-NEXT: packuswb %xmm1, %xmm7
-; SSE-NEXT: packuswb %xmm2, %xmm7
-; SSE-NEXT: pxor %xmm8, %xmm8
-; SSE-NEXT: movdqa %xmm11, %xmm0
-; SSE-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8],xmm8[8],xmm0[9],xmm8[9],xmm0[10],xmm8[10],xmm0[11],xmm8[11],xmm0[12],xmm8[12],xmm0[13],xmm8[13],xmm0[14],xmm8[14],xmm0[15],xmm8[15]
+; SSE-NEXT: packuswb %xmm2, %xmm2
+; SSE-NEXT: movdqa %xmm10, %xmm1
+; SSE-NEXT: pand %xmm0, %xmm1
+; SSE-NEXT: pand %xmm9, %xmm0
+; SSE-NEXT: packuswb %xmm1, %xmm0
+; SSE-NEXT: packuswb %xmm0, %xmm0
+; SSE-NEXT: packuswb %xmm0, %xmm2
+; SSE-NEXT: movdqa %xmm2, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; SSE-NEXT: pxor %xmm7, %xmm7
+; SSE-NEXT: movdqa %xmm14, %xmm0
+; SSE-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8],xmm7[8],xmm0[9],xmm7[9],xmm0[10],xmm7[10],xmm0[11],xmm7[11],xmm0[12],xmm7[12],xmm0[13],xmm7[13],xmm0[14],xmm7[14],xmm0[15],xmm7[15]
; SSE-NEXT: movdqa %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: movdqa %xmm11, %xmm15
-; SSE-NEXT: punpcklbw {{.*#+}} xmm15 = xmm15[0],xmm8[0],xmm15[1],xmm8[1],xmm15[2],xmm8[2],xmm15[3],xmm8[3],xmm15[4],xmm8[4],xmm15[5],xmm8[5],xmm15[6],xmm8[6],xmm15[7],xmm8[7]
-; SSE-NEXT: movdqa %xmm15, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: punpcklwd {{.*#+}} xmm15 = xmm15[0],xmm0[0],xmm15[1],xmm0[1],xmm15[2],xmm0[2],xmm15[3],xmm0[3]
-; SSE-NEXT: packuswb %xmm15, %xmm15
+; SSE-NEXT: movdqa %xmm14, %xmm15
+; SSE-NEXT: punpcklbw {{.*#+}} xmm15 = xmm15[0],xmm7[0],xmm15[1],xmm7[1],xmm15[2],xmm7[2],xmm15[3],xmm7[3],xmm15[4],xmm7[4],xmm15[5],xmm7[5],xmm15[6],xmm7[6],xmm15[7],xmm7[7]
+; SSE-NEXT: movdqa %xmm15, %xmm5
+; SSE-NEXT: punpcklwd {{.*#+}} xmm5 = xmm5[0],xmm0[0],xmm5[1],xmm0[1],xmm5[2],xmm0[2],xmm5[3],xmm0[3]
+; SSE-NEXT: packuswb %xmm5, %xmm5
; SSE-NEXT: movdqa {{.*#+}} xmm3 = [65535,0,65535,65535,65535,65535,65535,65535]
; SSE-NEXT: movdqa %xmm3, %xmm2
-; SSE-NEXT: pandn %xmm15, %xmm2
+; SSE-NEXT: pandn %xmm5, %xmm2
; SSE-NEXT: movdqa %xmm12, %xmm0
-; SSE-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8],xmm8[8],xmm0[9],xmm8[9],xmm0[10],xmm8[10],xmm0[11],xmm8[11],xmm0[12],xmm8[12],xmm0[13],xmm8[13],xmm0[14],xmm8[14],xmm0[15],xmm8[15]
+; SSE-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8],xmm7[8],xmm0[9],xmm7[9],xmm0[10],xmm7[10],xmm0[11],xmm7[11],xmm0[12],xmm7[12],xmm0[13],xmm7[13],xmm0[14],xmm7[14],xmm0[15],xmm7[15]
; SSE-NEXT: movdqa %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: movdqa %xmm12, %xmm5
-; SSE-NEXT: punpcklbw {{.*#+}} xmm5 = xmm5[0],xmm8[0],xmm5[1],xmm8[1],xmm5[2],xmm8[2],xmm5[3],xmm8[3],xmm5[4],xmm8[4],xmm5[5],xmm8[5],xmm5[6],xmm8[6],xmm5[7],xmm8[7]
-; SSE-NEXT: movdqa %xmm5, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: punpcklwd {{.*#+}} xmm5 = xmm5[0],xmm0[0],xmm5[1],xmm0[1],xmm5[2],xmm0[2],xmm5[3],xmm0[3]
-; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm5[1,1,1,1]
-; SSE-NEXT: packuswb %xmm4, %xmm4
-; SSE-NEXT: pand %xmm3, %xmm4
-; SSE-NEXT: por %xmm2, %xmm4
+; SSE-NEXT: movdqa %xmm12, %xmm11
+; SSE-NEXT: punpcklbw {{.*#+}} xmm11 = xmm11[0],xmm7[0],xmm11[1],xmm7[1],xmm11[2],xmm7[2],xmm11[3],xmm7[3],xmm11[4],xmm7[4],xmm11[5],xmm7[5],xmm11[6],xmm7[6],xmm11[7],xmm7[7]
+; SSE-NEXT: movdqa %xmm11, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; SSE-NEXT: punpcklwd {{.*#+}} xmm11 = xmm11[0],xmm0[0],xmm11[1],xmm0[1],xmm11[2],xmm0[2],xmm11[3],xmm0[3]
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm11[1,1,1,1]
+; SSE-NEXT: packuswb %xmm0, %xmm0
+; SSE-NEXT: pand %xmm3, %xmm0
+; SSE-NEXT: por %xmm2, %xmm0
; SSE-NEXT: movdqa %xmm10, %xmm1
-; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm8[8],xmm1[9],xmm8[9],xmm1[10],xmm8[10],xmm1[11],xmm8[11],xmm1[12],xmm8[12],xmm1[13],xmm8[13],xmm1[14],xmm8[14],xmm1[15],xmm8[15]
+; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm7[8],xmm1[9],xmm7[9],xmm1[10],xmm7[10],xmm1[11],xmm7[11],xmm1[12],xmm7[12],xmm1[13],xmm7[13],xmm1[14],xmm7[14],xmm1[15],xmm7[15]
; SSE-NEXT: movdqa %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: movdqa %xmm10, %xmm9
-; SSE-NEXT: punpcklbw {{.*#+}} xmm9 = xmm9[0],xmm8[0],xmm9[1],xmm8[1],xmm9[2],xmm8[2],xmm9[3],xmm8[3],xmm9[4],xmm8[4],xmm9[5],xmm8[5],xmm9[6],xmm8[6],xmm9[7],xmm8[7]
-; SSE-NEXT: movdqa %xmm9, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: punpcklwd {{.*#+}} xmm9 = xmm9[0],xmm1[0],xmm9[1],xmm1[1],xmm9[2],xmm1[2],xmm9[3],xmm1[3]
-; SSE-NEXT: packuswb %xmm9, %xmm9
-; SSE-NEXT: pshufd {{.*#+}} xmm13 = xmm9[0,0,2,3]
+; SSE-NEXT: movdqa %xmm10, %xmm13
+; SSE-NEXT: punpcklbw {{.*#+}} xmm13 = xmm13[0],xmm7[0],xmm13[1],xmm7[1],xmm13[2],xmm7[2],xmm13[3],xmm7[3],xmm13[4],xmm7[4],xmm13[5],xmm7[5],xmm13[6],xmm7[6],xmm13[7],xmm7[7]
+; SSE-NEXT: movdqa %xmm13, %xmm4
+; SSE-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1],xmm4[2],xmm1[2],xmm4[3],xmm1[3]
+; SSE-NEXT: packuswb %xmm4, %xmm4
+; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm4[0,0,2,3]
; SSE-NEXT: movdqa {{.*#+}} xmm2 = [65535,65535,65535,0,65535,65535,65535,65535]
; SSE-NEXT: movdqa %xmm2, %xmm6
-; SSE-NEXT: pandn %xmm13, %xmm6
-; SSE-NEXT: movdqa %xmm14, %xmm1
-; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm8[8],xmm1[9],xmm8[9],xmm1[10],xmm8[10],xmm1[11],xmm8[11],xmm1[12],xmm8[12],xmm1[13],xmm8[13],xmm1[14],xmm8[14],xmm1[15],xmm8[15]
+; SSE-NEXT: pandn %xmm8, %xmm6
+; SSE-NEXT: movdqa %xmm9, %xmm1
+; SSE-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm7[8],xmm1[9],xmm7[9],xmm1[10],xmm7[10],xmm1[11],xmm7[11],xmm1[12],xmm7[12],xmm1[13],xmm7[13],xmm1[14],xmm7[14],xmm1[15],xmm7[15]
; SSE-NEXT: movdqa %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: movdqa %xmm14, %xmm13
-; SSE-NEXT: punpcklbw {{.*#+}} xmm13 = xmm13[0],xmm8[0],xmm13[1],xmm8[1],xmm13[2],xmm8[2],xmm13[3],xmm8[3],xmm13[4],xmm8[4],xmm13[5],xmm8[5],xmm13[6],xmm8[6],xmm13[7],xmm8[7]
-; SSE-NEXT: movdqa %xmm13, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: punpcklwd {{.*#+}} xmm13 = xmm13[0],xmm1[0],xmm13[1],xmm1[1],xmm13[2],xmm1[2],xmm13[3],xmm1[3]
-; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm13[0,1,1,3]
+; SSE-NEXT: movdqa %xmm9, %xmm8
+; SSE-NEXT: punpcklbw {{.*#+}} xmm8 = xmm8[0],xmm7[0],xmm8[1],xmm7[1],xmm8[2],xmm7[2],xmm8[3],xmm7[3],xmm8[4],xmm7[4],xmm8[5],xmm7[5],xmm8[6],xmm7[6],xmm8[7],xmm7[7]
+; SSE-NEXT: movdqa %xmm8, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; SSE-NEXT: movdqa %xmm8, %xmm7
+; SSE-NEXT: punpcklwd {{.*#+}} xmm7 = xmm7[0],xmm1[0],xmm7[1],xmm1[1],xmm7[2],xmm1[2],xmm7[3],xmm1[3]
+; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,1,1,3]
; SSE-NEXT: packuswb %xmm8, %xmm8
; SSE-NEXT: pand %xmm2, %xmm8
; SSE-NEXT: por %xmm6, %xmm8
; SSE-NEXT: pshufd {{.*#+}} xmm6 = xmm8[1,1,1,1]
-; SSE-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
-; SSE-NEXT: movdqa %xmm4, (%rsp) # 16-byte Spill
+; SSE-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
+; SSE-NEXT: movdqa %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
; SSE-NEXT: movdqa {{.*#+}} xmm6 = [255,255,255,255,255,255,255,255]
-; SSE-NEXT: pand %xmm6, %xmm11
-; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm11[0,2,2,3]
+; SSE-NEXT: pand %xmm6, %xmm14
+; SSE-NEXT: pshufd {{.*#+}} xmm8 = xmm14[0,2,2,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm8 = xmm8[0,1,1,3,4,5,6,7]
; SSE-NEXT: packuswb %xmm8, %xmm8
; SSE-NEXT: movdqa %xmm3, %xmm1
@@ -463,127 +467,124 @@ define void @load_i8_stride8_vf8(ptr %in.vec, ptr %out.vec0, ptr %out.vec1, ptr
; SSE-NEXT: packuswb %xmm1, %xmm1
; SSE-NEXT: movdqa %xmm2, %xmm0
; SSE-NEXT: pandn %xmm1, %xmm0
-; SSE-NEXT: pand %xmm6, %xmm14
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm14[0,1,2,0]
+; SSE-NEXT: pand %xmm6, %xmm9
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm9[0,1,2,0]
; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,7,5,6,7]
; SSE-NEXT: packuswb %xmm1, %xmm1
; SSE-NEXT: pand %xmm2, %xmm1
; SSE-NEXT: por %xmm0, %xmm1
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,1,1]
; SSE-NEXT: punpckldq {{.*#+}} xmm8 = xmm8[0],xmm0[0],xmm8[1],xmm0[1]
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm15[1,1,2,3]
-; SSE-NEXT: movdqa %xmm3, %xmm1
-; SSE-NEXT: pandn %xmm0, %xmm1
-; SSE-NEXT: pshufd {{.*#+}} xmm15 = xmm5[3,3,3,3]
-; SSE-NEXT: packuswb %xmm15, %xmm15
-; SSE-NEXT: pand %xmm3, %xmm15
-; SSE-NEXT: por %xmm1, %xmm15
-; SSE-NEXT: movdqa %xmm2, %xmm0
-; SSE-NEXT: pandn %xmm9, %xmm0
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm13[2,2,3,3]
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm5[1,1,2,3]
+; SSE-NEXT: movdqa %xmm3, %xmm5
+; SSE-NEXT: pandn %xmm0, %xmm5
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm11[3,3,3,3]
; SSE-NEXT: packuswb %xmm1, %xmm1
-; SSE-NEXT: pand %xmm2, %xmm1
-; SSE-NEXT: por %xmm0, %xmm1
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,1,1]
-; SSE-NEXT: punpckldq {{.*#+}} xmm15 = xmm15[0],xmm0[0],xmm15[1],xmm0[1]
-; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm11[3,1,2,3]
+; SSE-NEXT: pand %xmm3, %xmm1
+; SSE-NEXT: por %xmm5, %xmm1
+; SSE-NEXT: movdqa %xmm2, %xmm0
+; SSE-NEXT: pandn %xmm4, %xmm0
+; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm7[2,2,3,3]
+; SSE-NEXT: packuswb %xmm4, %xmm4
+; SSE-NEXT: pand %xmm2, %xmm4
+; SSE-NEXT: por %xmm0, %xmm4
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm4[1,1,1,1]
+; SSE-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
+; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm14[3,1,2,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm4[0,1,2,0,4,5,6,7]
; SSE-NEXT: packuswb %xmm0, %xmm0
-; SSE-NEXT: movdqa %xmm3, %xmm1
-; SSE-NEXT: pandn %xmm0, %xmm1
-; SSE-NEXT: pshufd {{.*#+}} xmm12 = xmm12[3,1,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm11 = xmm12[2,0,2,3,4,5,6,7]
-; SSE-NEXT: packuswb %xmm11, %xmm11
-; SSE-NEXT: pand %xmm3, %xmm11
-; SSE-NEXT: por %xmm1, %xmm11
+; SSE-NEXT: movdqa %xmm3, %xmm5
+; SSE-NEXT: pandn %xmm0, %xmm5
+; SSE-NEXT: pshufd {{.*#+}} xmm7 = xmm12[3,1,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm12 = xmm7[2,0,2,3,4,5,6,7]
+; SSE-NEXT: packuswb %xmm12, %xmm12
+; SSE-NEXT: pand %xmm3, %xmm12
+; SSE-NEXT: por %xmm5, %xmm12
; SSE-NEXT: pshufd {{.*#+}} xmm10 = xmm10[0,1,1,3]
; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm10[0,1,2,3,4,5,4,6]
; SSE-NEXT: packuswb %xmm0, %xmm0
-; SSE-NEXT: movdqa %xmm2, %xmm1
-; SSE-NEXT: pandn %xmm0, %xmm1
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm14[0,1,1,3]
-; SSE-NEXT: pshufhw {{.*#+}} xmm5 = xmm0[0,1,2,3,4,6,6,7]
-; SSE-NEXT: packuswb %xmm5, %xmm5
-; SSE-NEXT: pand %xmm2, %xmm5
-; SSE-NEXT: por %xmm1, %xmm5
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm5[1,1,1,1]
-; SSE-NEXT: punpckldq {{.*#+}} xmm11 = xmm11[0],xmm1[0],xmm11[1],xmm1[1]
-; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm5 # 16-byte Reload
-; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm5 # 16-byte Folded Reload
-; SSE-NEXT: # xmm5 = xmm5[4],mem[4],xmm5[5],mem[5],xmm5[6],mem[6],xmm5[7],mem[7]
-; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm14 # 16-byte Reload
-; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm14 # 16-byte Folded Reload
-; SSE-NEXT: # xmm14 = xmm14[4],mem[4],xmm14[5],mem[5],xmm14[6],mem[6],xmm14[7],mem[7]
-; SSE-NEXT: packuswb %xmm5, %xmm5
-; SSE-NEXT: movdqa %xmm5, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
-; SSE-NEXT: movdqa %xmm3, %xmm1
-; SSE-NEXT: pandn %xmm5, %xmm1
-; SSE-NEXT: pshufd {{.*#+}} xmm5 = xmm14[1,1,1,1]
-; SSE-NEXT: packuswb %xmm5, %xmm5
-; SSE-NEXT: pand %xmm3, %xmm5
-; SSE-NEXT: por %xmm1, %xmm5
-; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm9 # 16-byte Reload
-; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm9 # 16-byte Folded Reload
-; SSE-NEXT: # xmm9 = xmm9[4],mem[4],xmm9[5],mem[5],xmm9[6],mem[6],xmm9[7],mem[7]
+; SSE-NEXT: movdqa %xmm2, %xmm5
+; SSE-NEXT: pandn %xmm0, %xmm5
+; SSE-NEXT: pshufd {{.*#+}} xmm11 = xmm9[0,1,1,3]
+; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm11[0,1,2,3,4,6,6,7]
+; SSE-NEXT: packuswb %xmm0, %xmm0
+; SSE-NEXT: pand %xmm2, %xmm0
+; SSE-NEXT: por %xmm5, %xmm0
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
+; SSE-NEXT: punpckldq {{.*#+}} xmm12 = xmm12[0],xmm0[0],xmm12[1],xmm0[1]
+; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 # 16-byte Folded Reload
+; SSE-NEXT: # xmm15 = xmm15[4],mem[4],xmm15[5],mem[5],xmm15[6],mem[6],xmm15[7],mem[7]
+; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm6 # 16-byte Reload
+; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm6 # 16-byte Folded Reload
+; SSE-NEXT: # xmm6 = xmm6[4],mem[4],xmm6[5],mem[5],xmm6[6],mem[6],xmm6[7],mem[7]
+; SSE-NEXT: packuswb %xmm15, %xmm15
+; SSE-NEXT: movdqa %xmm3, %xmm0
+; SSE-NEXT: pandn %xmm15, %xmm0
+; SSE-NEXT: pshufd {{.*#+}} xmm9 = xmm6[1,1,1,1]
; SSE-NEXT: packuswb %xmm9, %xmm9
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm9[0,0,2,3]
-; SSE-NEXT: movdqa %xmm2, %xmm6
-; SSE-NEXT: pandn %xmm1, %xmm6
-; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm13 # 16-byte Reload
+; SSE-NEXT: pand %xmm3, %xmm9
+; SSE-NEXT: por %xmm0, %xmm9
; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm13 # 16-byte Folded Reload
; SSE-NEXT: # xmm13 = xmm13[4],mem[4],xmm13[5],mem[5],xmm13[6],mem[6],xmm13[7],mem[7]
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm13[0,1,1,3]
-; SSE-NEXT: packuswb %xmm1, %xmm1
-; SSE-NEXT: pand %xmm2, %xmm1
-; SSE-NEXT: por %xmm6, %xmm1
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,1,1]
-; SSE-NEXT: punpckldq {{.*#+}} xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
-; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm4[0,1,3,1,4,5,6,7]
-; SSE-NEXT: packuswb %xmm1, %xmm1
-; SSE-NEXT: movdqa %xmm3, %xmm6
-; SSE-NEXT: pandn %xmm1, %xmm6
-; SSE-NEXT: pshuflw {{.*#+}} xmm4 = xmm12[3,1,2,3,4,5,6,7]
+; SSE-NEXT: packuswb %xmm13, %xmm13
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm13[0,0,2,3]
+; SSE-NEXT: movdqa %xmm2, %xmm5
+; SSE-NEXT: pandn %xmm0, %xmm5
+; SSE-NEXT: movdqa {{[-0-9]+}}(%r{{[sb]}}p), %xmm14 # 16-byte Reload
+; SSE-NEXT: punpckhwd {{[-0-9]+}}(%r{{[sb]}}p), %xmm14 # 16-byte Folded Reload
+; SSE-NEXT: # xmm14 = xmm14[4],mem[4],xmm14[5],mem[5],xmm14[6],mem[6],xmm14[7],mem[7]
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm14[0,1,1,3]
+; SSE-NEXT: packuswb %xmm0, %xmm0
+; SSE-NEXT: pand %xmm2, %xmm0
+; SSE-NEXT: por %xmm5, %xmm0
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
+; SSE-NEXT: punpckldq {{.*#+}} xmm9 = xmm9[0],xmm0[0],xmm9[1],xmm0[1]
+; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm4[0,1,3,1,4,5,6,7]
+; SSE-NEXT: packuswb %xmm0, %xmm0
+; SSE-NEXT: movdqa %xmm3, %xmm5
+; SSE-NEXT: pandn %xmm0, %xmm5
+; SSE-NEXT: pshuflw {{.*#+}} xmm4 = xmm7[3,1,2,3,4,5,6,7]
; SSE-NEXT: packuswb %xmm4, %xmm4
; SSE-NEXT: pand %xmm3, %xmm4
-; SSE-NEXT: por %xmm6, %xmm4
-; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm10[0,1,2,3,4,5,5,7]
-; SSE-NEXT: packuswb %xmm1, %xmm1
-; SSE-NEXT: movdqa %xmm2, %xmm6
-; SSE-NEXT: pandn %xmm1, %xmm6
-; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,5,7,6,7]
+; SSE-NEXT: por %xmm5, %xmm4
+; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm10[0,1,2,3,4,5,5,7]
+; SSE-NEXT: packuswb %xmm0, %xmm0
+; SSE-NEXT: movdqa %xmm2, %xmm5
+; SSE-NEXT: pandn %xmm0, %xmm5
+; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm11[0,1,2,3,5,7,6,7]
; SSE-NEXT: packuswb %xmm0, %xmm0
; SSE-NEXT: pand %xmm2, %xmm0
-; SSE-NEXT: por %xmm6, %xmm0
+; SSE-NEXT: por %xmm5, %xmm0
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
; SSE-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1]
-; SSE-NEXT: pshufd $229, {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Folded Reload
-; SSE-NEXT: # xmm0 = mem[1,1,2,3]
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm14[3,3,3,3]
-; SSE-NEXT: packuswb %xmm1, %xmm1
-; SSE-NEXT: pand %xmm3, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm15[1,1,2,3]
+; SSE-NEXT: pshufd {{.*#+}} xmm5 = xmm6[3,3,3,3]
+; SSE-NEXT: packuswb %xmm5, %xmm5
+; SSE-NEXT: pand %xmm3, %xmm5
; SSE-NEXT: pandn %xmm0, %xmm3
-; SSE-NEXT: por %xmm1, %xmm3
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm13[2,2,3,3]
+; SSE-NEXT: por %xmm5, %xmm3
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm14[2,2,3,3]
; SSE-NEXT: packuswb %xmm0, %xmm0
; SSE-NEXT: pand %xmm2, %xmm0
-; SSE-NEXT: pandn %xmm9, %xmm2
+; SSE-NEXT: pandn %xmm13, %xmm2
; SSE-NEXT: por %xmm0, %xmm2
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,1,1]
; SSE-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
-; SSE-NEXT: packuswb %xmm7, %xmm7
-; SSE-NEXT: movq %xmm7, (%rsi)
-; SSE-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
+; SSE-NEXT: pshufd $236, {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Folded Reload
+; SSE-NEXT: # xmm0 = mem[0,3,2,3]
+; SSE-NEXT: movq %xmm0, (%rsi)
+; SSE-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload
; SSE-NEXT: movlps %xmm0, (%rdx)
; SSE-NEXT: movq %xmm8, (%rcx)
-; SSE-NEXT: movq %xmm15, (%r8)
-; SSE-NEXT: movq %xmm11, (%r9)
+; SSE-NEXT: movq %xmm1, (%r8)
+; SSE-NEXT: movq %xmm12, (%r9)
; SSE-NEXT: movq {{[0-9]+}}(%rsp), %rax
-; SSE-NEXT: movq %xmm5, (%rax)
+; SSE-NEXT: movq %xmm9, (%rax)
; SSE-NEXT: movq {{[0-9]+}}(%rsp), %rax
; SSE-NEXT: movq %xmm4, (%rax)
; SSE-NEXT: movq {{[0-9]+}}(%rsp), %rax
; SSE-NEXT: movq %xmm3, (%rax)
-; SSE-NEXT: addq $24, %rsp
+; SSE-NEXT: popq %rax
; SSE-NEXT: retq
;
; AVX1-ONLY-LABEL: load_i8_stride8_vf8:
diff --git a/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-6.ll b/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-6.ll
index 616c46cde4cc30..bb052c6fa70d94 100644
--- a/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-6.ll
+++ b/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-6.ll
@@ -87,24 +87,24 @@ define void @store_i8_stride6_vf4(ptr %in.vecptr0, ptr %in.vecptr1, ptr %in.vecp
; SSE-LABEL: store_i8_stride6_vf4:
; SSE: # %bb.0:
; SSE-NEXT: movq {{[0-9]+}}(%rsp), %rax
-; SSE-NEXT: movdqa (%rdi), %xmm2
-; SSE-NEXT: movdqa (%rdx), %xmm1
+; SSE-NEXT: movdqa (%rdi), %xmm1
+; SSE-NEXT: movdqa (%rdx), %xmm2
; SSE-NEXT: movdqa (%r8), %xmm0
-; SSE-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
; SSE-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
+; SSE-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
; SSE-NEXT: pxor %xmm3, %xmm3
-; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3],xmm1[4],xmm3[4],xmm1[5],xmm3[5],xmm1[6],xmm3[6],xmm1[7],xmm3[7]
-; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm1[0,2,2,3]
+; SSE-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3],xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
+; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm2[0,2,2,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm4 = xmm4[0,1,0,2,4,5,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm5 = xmm1[0,2,1,3]
+; SSE-NEXT: pshufd {{.*#+}} xmm5 = xmm2[0,2,1,3]
; SSE-NEXT: pshuflw {{.*#+}} xmm5 = xmm5[1,3,2,3,4,5,6,7]
; SSE-NEXT: pshufhw {{.*#+}} xmm5 = xmm5[0,1,2,3,4,5,4,6]
; SSE-NEXT: packuswb %xmm5, %xmm4
; SSE-NEXT: movdqa {{.*#+}} xmm5 = [65535,0,65535,65535,0,65535,65535,0]
-; SSE-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3],xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
-; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,1,1,3]
+; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3],xmm1[4],xmm3[4],xmm1[5],xmm3[5],xmm1[6],xmm3[6],xmm1[7],xmm3[7]
+; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm1[0,1,1,3]
; SSE-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,4,6,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm6 = xmm2[0,2,2,0]
+; SSE-NEXT: pshufd {{.*#+}} xmm6 = xmm1[0,2,2,0]
; SSE-NEXT: pshuflw {{.*#+}} xmm6 = xmm6[0,2,2,3,4,5,6,7]
; SSE-NEXT: pshufhw {{.*#+}} xmm6 = xmm6[0,1,2,3,4,5,7,5]
; SSE-NEXT: packuswb %xmm3, %xmm6
@@ -117,12 +117,12 @@ define void @store_i8_stride6_vf4(ptr %in.vecptr0, ptr %in.vecptr1, ptr %in.vecp
; SSE-NEXT: pshufd {{.*#+}} xmm4 = xmm0[0,0,0,0]
; SSE-NEXT: pandn %xmm4, %xmm3
; SSE-NEXT: por %xmm5, %xmm3
-; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[3,1,2,3]
-; SSE-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[0,1,3,1,4,5,6,7]
-; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,1,1,3]
-; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,5,7,6,7]
-; SSE-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
-; SSE-NEXT: packuswb %xmm1, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,1,1,3]
+; SSE-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,5,7,6,7]
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[3,1,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,3,1,4,5,6,7]
+; SSE-NEXT: packuswb %xmm2, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,3,2,3]
; SSE-NEXT: movdqa {{.*#+}} xmm2 = [65535,0,0,65535,65535,65535,65535,65535]
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
; SSE-NEXT: pand %xmm2, %xmm0
diff --git a/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-8.ll b/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-8.ll
index 1cdc9c3862109b..69fb5834962d54 100644
--- a/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-8.ll
+++ b/llvm/test/CodeGen/X86/vector-interleaved-store-i8-stride-8.ll
@@ -31,23 +31,28 @@ define void @store_i8_stride8_vf2(ptr %in.vecptr0, ptr %in.vecptr1, ptr %in.vecp
; SSE-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],mem[0],xmm2[1],mem[1],xmm2[2],mem[2],xmm2[3],mem[3]
; SSE-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],mem[0],xmm3[1],mem[1],xmm3[2],mem[2],xmm3[3],mem[3]
; SSE-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
-; SSE-NEXT: movdqa %xmm0, %xmm1
-; SSE-NEXT: psrlw $8, %xmm1
-; SSE-NEXT: pxor %xmm3, %xmm3
-; SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3],xmm0[4],xmm3[4],xmm0[5],xmm3[5],xmm0[6],xmm3[6],xmm0[7],xmm3[7]
-; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
-; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,4,6,6,7]
-; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,1]
-; SSE-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3],xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
-; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm2[0,2,2,3,4,5,6,7]
-; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,4,6,6,7]
+; SSE-NEXT: pxor %xmm1, %xmm1
+; SSE-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
+; SSE-NEXT: pshuflw {{.*#+}} xmm3 = xmm2[0,2,2,3,4,5,6,7]
+; SSE-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,4,6,6,7]
+; SSE-NEXT: pshufd {{.*#+}} xmm3 = xmm3[0,1,0,2]
; SSE-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[3,1,2,3,4,5,6,7]
; SSE-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,7,5,6,7]
; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,1,2,0]
; SSE-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,7,6,5,4]
-; SSE-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,2],xmm2[2,3]
-; SSE-NEXT: packuswb %xmm1, %xmm0
-; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,1,3]
+; SSE-NEXT: packuswb %xmm2, %xmm3
+; SSE-NEXT: pshufd {{.*#+}} xmm2 = xmm3[1,3,2,3]
+; SSE-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
+; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm0[0,2,2,3,4,5,6,7]
+; SSE-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,4,6,6,7]
+; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[3,1,2,3,4,5,6,7]
+; SSE-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,7,5,6,7]
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
+; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[1,0,3,2,4,5,6,7]
+; SSE-NEXT: packuswb %xmm0, %xmm1
+; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
+; SSE-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
; SSE-NEXT: movdqa %xmm0, (%rax)
; SSE-NEXT: retq
;
More information about the llvm-commits
mailing list