[llvm] r342346 - [x86] add failure to splat test (PR38949); NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 16 07:59:04 PDT 2018


Author: spatel
Date: Sun Sep 16 07:59:04 2018
New Revision: 342346

URL: http://llvm.org/viewvc/llvm-project?rev=342346&view=rev
Log:
[x86] add failure to splat test (PR38949); NFC

Modified:
    llvm/trunk/test/CodeGen/X86/avx-vbroadcastf128.ll

Modified: llvm/trunk/test/CodeGen/X86/avx-vbroadcastf128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-vbroadcastf128.ll?rev=342346&r1=342345&r2=342346&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx-vbroadcastf128.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx-vbroadcastf128.ll Sun Sep 16 07:59:04 2018
@@ -98,6 +98,33 @@ define <32 x i8> @test_broadcast_16i8_32
  ret <32 x i8> %2
 }
 
+; PR38949 - https://bugs.llvm.org/show_bug.cgi?id=38949
+; Don't limit the transform based on extra uses of the load itself (the store is a user of the load's chain value).
+
+define void @subv_reuse_is_ok(<4 x float>* %a, <8 x float>* %b) {
+; X32-LABEL: subv_reuse_is_ok:
+; X32:       # %bb.0:
+; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X32-NEXT:    vmovups (%ecx), %xmm0
+; X32-NEXT:    vinsertf128 $1, %xmm0, %ymm0, %ymm0
+; X32-NEXT:    vmovups %ymm0, (%eax)
+; X32-NEXT:    vzeroupper
+; X32-NEXT:    retl
+;
+; X64-LABEL: subv_reuse_is_ok:
+; X64:       # %bb.0:
+; X64-NEXT:    vmovups (%rdi), %xmm0
+; X64-NEXT:    vinsertf128 $1, %xmm0, %ymm0, %ymm0
+; X64-NEXT:    vmovups %ymm0, (%rsi)
+; X64-NEXT:    vzeroupper
+; X64-NEXT:    retq
+  %ld = load <4 x float>, <4 x float>* %a, align 1
+  %splat128 = shufflevector <4 x float> %ld, <4 x float> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
+  store <8 x float> %splat128, <8 x float>* %b, align 16
+  ret void
+}
+
 define <4 x double> @test_broadcast_2f64_4f64_reuse(<2 x double>* %p0, <2 x double>* %p1) {
 ; X32-LABEL: test_broadcast_2f64_4f64_reuse:
 ; X32:       # %bb.0:




More information about the llvm-commits mailing list