]> granicus.if.org Git - llvm/commitdiff
[X86] Add test cases for incorrect shrinking of volatile vector loads from 128-bits...
authorCraig Topper <craig.topper@intel.com>
Fri, 21 Jun 2019 20:16:26 +0000 (20:16 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 21 Jun 2019 20:16:26 +0000 (20:16 +0000)
This is caused by isel patterns that look for vzmovl+load and
treat it the same as vzload.

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

test/CodeGen/X86/vector-zmov.ll

index 6f2f78263b281d23c1fb0b06cc6191327e7d213f..5dfdf4fe442bcf1614b2112742a7a4eece33b381 100644 (file)
@@ -36,3 +36,37 @@ entry:
   %Y = shufflevector <2 x i64> %X, <2 x i64> zeroinitializer, <2 x i32> <i32 0, i32 2>
   ret <2 x i64>%Y
 }
+
+; FIXME: We shouldn't shrink the load to movss here since it is volatile.
+define <4 x i32> @load_zmov_4i32_to_0zzz_volatile(<4 x i32> *%ptr) {
+; SSE-LABEL: load_zmov_4i32_to_0zzz_volatile:
+; SSE:       # %bb.0: # %entry
+; SSE-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; SSE-NEXT:    retq
+;
+; AVX-LABEL: load_zmov_4i32_to_0zzz_volatile:
+; AVX:       # %bb.0: # %entry
+; AVX-NEXT:    vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; AVX-NEXT:    retq
+entry:
+  %X = load volatile <4 x i32>, <4 x i32>* %ptr
+  %Y = shufflevector <4 x i32> %X, <4 x i32> zeroinitializer, <4 x i32> <i32 0, i32 4, i32 4, i32 4>
+  ret <4 x i32>%Y
+}
+
+; FIXME: We shouldn't shrink the load to movsd here since it is volatile.
+define <2 x i64> @load_zmov_2i64_to_0z_volatile(<2 x i64> *%ptr) {
+; SSE-LABEL: load_zmov_2i64_to_0z_volatile:
+; SSE:       # %bb.0: # %entry
+; SSE-NEXT:    movsd {{.*#+}} xmm0 = mem[0],zero
+; SSE-NEXT:    retq
+;
+; AVX-LABEL: load_zmov_2i64_to_0z_volatile:
+; AVX:       # %bb.0: # %entry
+; AVX-NEXT:    vmovsd {{.*#+}} xmm0 = mem[0],zero
+; AVX-NEXT:    retq
+entry:
+  %X = load volatile <2 x i64>, <2 x i64>* %ptr
+  %Y = shufflevector <2 x i64> %X, <2 x i64> zeroinitializer, <2 x i32> <i32 0, i32 2>
+  ret <2 x i64>%Y
+}