diff --git a/llvm/test/CodeGen/X86/combine-sra.ll b/llvm/test/CodeGen/X86/combine-sra.ll index bfa5b9e98b11..99051d554f46 100644 --- a/llvm/test/CodeGen/X86/combine-sra.ll +++ b/llvm/test/CodeGen/X86/combine-sra.ll @@ -296,3 +296,21 @@ define <4 x i32> @combine_vec_ashr_positive(<4 x i32> %x, <4 x i32> %y) { %2 = ashr <4 x i32> %1, %y ret <4 x i32> %2 } + +define <4 x i32> @combine_vec_ashr_positive_splat(<4 x i32> %x, <4 x i32> %y) { +; SSE-LABEL: combine_vec_ashr_positive_splat: +; SSE: # BB#0: +; SSE-NEXT: pand {{.*}}(%rip), %xmm0 +; SSE-NEXT: psrld $10, %xmm0 +; SSE-NEXT: retq +; +; AVX-LABEL: combine_vec_ashr_positive_splat: +; AVX: # BB#0: +; AVX-NEXT: vpbroadcastd {{.*}}(%rip), %xmm1 +; AVX-NEXT: vpand %xmm1, %xmm0, %xmm0 +; AVX-NEXT: vpsrld $10, %xmm0, %xmm0 +; AVX-NEXT: retq + %1 = and <4 x i32> %x, + %2 = ashr <4 x i32> %1, + ret <4 x i32> %2 +}