[llvm] r337356 - [X86] Add test case for missed opportunity to commute vunpckhpd to enable use of vmovlps to fold a load.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 18 00:31:30 PDT 2018
Author: ctopper
Date: Wed Jul 18 00:31:30 2018
New Revision: 337356
URL: http://llvm.org/viewvc/llvm-project?rev=337356&view=rev
Log:
[X86] Add test case for missed opportunity to commute vunpckhpd to enable use of vmovlps to fold a load.
We do this transform for SSE, but not AVX or AVX512VL.
Modified:
llvm/trunk/test/CodeGen/X86/vector-shuffle-128-v2.ll
Modified: llvm/trunk/test/CodeGen/X86/vector-shuffle-128-v2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vector-shuffle-128-v2.ll?rev=337356&r1=337355&r2=337356&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vector-shuffle-128-v2.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vector-shuffle-128-v2.ll Wed Jul 18 00:31:30 2018
@@ -1301,3 +1301,19 @@ define <2 x double> @shuffle_mem_v2f64_1
%shuffle = shufflevector <2 x double> %a, <2 x double> undef, <2 x i32> <i32 1, i32 0>
ret <2 x double> %shuffle
}
+
+define <2 x double> @shuffle_mem_v2f64_31(<2 x double> %a, <2 x double>* %b) {
+; SSE-LABEL: shuffle_mem_v2f64_31:
+; SSE: # %bb.0:
+; SSE-NEXT: movlps {{.*#+}} xmm0 = mem[0,1],xmm0[2,3]
+; SSE-NEXT: retq
+;
+; AVX-LABEL: shuffle_mem_v2f64_31:
+; AVX: # %bb.0:
+; AVX-NEXT: vmovaps (%rdi), %xmm1
+; AVX-NEXT: vunpckhpd {{.*#+}} xmm0 = xmm1[1],xmm0[1]
+; AVX-NEXT: retq
+ %c = load <2 x double>, <2 x double>* %b
+ %f = shufflevector <2 x double> %a, <2 x double> %c, <2 x i32> <i32 3, i32 1>
+ ret <2 x double> %f
+}
More information about the llvm-commits
mailing list