]> granicus.if.org Git - llvm/commitdiff
[X86][SSE] Add (V)MOVD folding pattern with zextloadi64i32 load node.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 17 Feb 2017 20:43:32 +0000 (20:43 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 17 Feb 2017 20:43:32 +0000 (20:43 +0000)
Fixes PRPR31309

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295492 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrAVX512.td
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/merge-consecutive-loads-128.ll

index f94ba848b3d1c1f232bc1060c2146eea70476071..ca79f320611e96d5e01956ab8eed0b2ef4c6211f 100644 (file)
@@ -3552,6 +3552,8 @@ let Predicates = [HasAVX512] in {
   }
   // AVX 128-bit movd/movq instruction write zeros in the high 128-bit part.
   let AddedComplexity = 20 in {
+    def : Pat<(v2i64 (X86vzmovl (v2i64 (scalar_to_vector (zextloadi64i32 addr:$src))))),
+              (VMOVDI2PDIZrm addr:$src)>;
     def : Pat<(v4i32 (X86vzmovl (v4i32 (scalar_to_vector (loadi32 addr:$src))))),
               (VMOVDI2PDIZrm addr:$src)>;
     def : Pat<(v4i32 (X86vzmovl (bc_v4i32 (loadv4f32 addr:$src)))),
index d2dfb1b5d7ddf9ff30d89709c926f83a943743cd..ec17ae083ad6c72e4f466dee1b3e961f682e4d64 100644 (file)
@@ -4822,6 +4822,8 @@ let Predicates = [UseAVX] in {
   // AVX 128-bit movd/movq instructions write zeros in the high 128-bit part.
   // These instructions also write zeros in the high part of a 256-bit register.
   let AddedComplexity = 20 in {
+    def : Pat<(v2i64 (X86vzmovl (v2i64 (scalar_to_vector (zextloadi64i32 addr:$src))))),
+              (VMOVDI2PDIrm addr:$src)>;
     def : Pat<(v4i32 (X86vzmovl (v4i32 (scalar_to_vector (loadi32 addr:$src))))),
               (VMOVDI2PDIrm addr:$src)>;
     def : Pat<(v4i32 (X86vzmovl (bc_v4i32 (loadv4f32 addr:$src)))),
@@ -4851,6 +4853,8 @@ let Predicates = [UseSSE2] in {
               (MOV64toPQIrr GR64:$src)>;
   }
   let AddedComplexity = 20 in {
+    def : Pat<(v2i64 (X86vzmovl (v2i64 (scalar_to_vector (zextloadi64i32 addr:$src))))),
+              (MOVDI2PDIrm addr:$src)>;
     def : Pat<(v4i32 (X86vzmovl (v4i32 (scalar_to_vector (loadi32 addr:$src))))),
               (MOVDI2PDIrm addr:$src)>;
     def : Pat<(v4i32 (X86vzmovl (bc_v4i32 (loadv4f32 addr:$src)))),
index 82df614a9c5664e9c442c13830da8ae0526500ec..e498eb7833781f19764ac52291dcaa718db26df4 100644 (file)
@@ -1137,18 +1137,16 @@ define <4 x float> @merge_4f32_f32_X0YY(float* %ptr0, float* %ptr1) nounwind uwt
 ; Extension tests.
 ;
 
-; FIXME: PR31309
+; PR31309
 define <4 x i32> @load_i32_zext_i128_v4i32(i32* %ptr) {
 ; SSE-LABEL: load_i32_zext_i128_v4i32:
 ; SSE:       # BB#0:
-; SSE-NEXT:    movl (%rdi), %eax
-; SSE-NEXT:    movd %rax, %xmm0
+; SSE-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
 ; SSE-NEXT:    retq
 ;
 ; AVX-LABEL: load_i32_zext_i128_v4i32:
 ; AVX:       # BB#0:
-; AVX-NEXT:    movl (%rdi), %eax
-; AVX-NEXT:    vmovq %rax, %xmm0
+; AVX-NEXT:    vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
 ; AVX-NEXT:    retq
 ;
 ; X32-SSE1-LABEL: load_i32_zext_i128_v4i32: