llvm.org GIT mirror llvm / d5d7df5
[3.9.1] Merging r282613 - [X86][AVX] Add test showing that VBROADCAST loads don't correctly respect dependencies As discussed in PR30596, this is a preliminary test update before we can merge r283070 Note: This required the test to be regenerated after the merge as 3.9.1 doesn't have trunk's latest lea -> mov simplifications git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@286248 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
1 changed file(s) with 59 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
545545 %6 = shufflevector <2 x double> %3, <2 x double> %5, <4 x i32>
546546 ret <4 x double> %6
547547 }
548
549 ;
550 ; FIXME: When VBROADCAST replaces an existing load, ensure it still respects lifetime dependencies.
551 ;
552 define float @broadcast_lifetime() nounwind {
553 ; X32-LABEL: broadcast_lifetime:
554 ; X32: ## BB#0:
555 ; X32-NEXT: pushl %esi
556 ; X32-NEXT: subl $40, %esp
557 ; X32-NEXT: leal {{[0-9]+}}(%esp), %esi
558 ; X32-NEXT: movl %esi, (%esp)
559 ; X32-NEXT: calll _gfunc
560 ; X32-NEXT: movl %esi, (%esp)
561 ; X32-NEXT: calll _gfunc
562 ; X32-NEXT: vbroadcastss {{[0-9]+}}(%esp), %xmm0
563 ; X32-NEXT: vbroadcastss {{[0-9]+}}(%esp), %xmm1
564 ; X32-NEXT: vsubss %xmm0, %xmm1, %xmm0
565 ; X32-NEXT: vmovss %xmm0, {{[0-9]+}}(%esp)
566 ; X32-NEXT: flds {{[0-9]+}}(%esp)
567 ; X32-NEXT: addl $40, %esp
568 ; X32-NEXT: popl %esi
569 ; X32-NEXT: retl
570 ;
571 ; X64-LABEL: broadcast_lifetime:
572 ; X64: ## BB#0:
573 ; X64-NEXT: subq $24, %rsp
574 ; X64-NEXT: leaq (%rsp), %rdi
575 ; X64-NEXT: callq _gfunc
576 ; X64-NEXT: leaq (%rsp), %rdi
577 ; X64-NEXT: callq _gfunc
578 ; X64-NEXT: vbroadcastss {{[0-9]+}}(%rsp), %xmm0
579 ; X64-NEXT: vbroadcastss {{[0-9]+}}(%rsp), %xmm1
580 ; X64-NEXT: vsubss %xmm0, %xmm1, %xmm0
581 ; X64-NEXT: addq $24, %rsp
582 ; X64-NEXT: retq
583 %1 = alloca <4 x float>, align 16
584 %2 = alloca <4 x float>, align 16
585 %3 = bitcast <4 x float>* %1 to i8*
586 %4 = bitcast <4 x float>* %2 to i8*
587
588 call void @llvm.lifetime.start(i64 16, i8* %3)
589 call void @gfunc(<4 x float>* %1)
590 %5 = load <4 x float>, <4 x float>* %1, align 16
591 call void @llvm.lifetime.end(i64 16, i8* %3)
592
593 call void @llvm.lifetime.start(i64 16, i8* %4)
594 call void @gfunc(<4 x float>* %2)
595 %6 = load <4 x float>, <4 x float>* %2, align 16
596 call void @llvm.lifetime.end(i64 16, i8* %4)
597
598 %7 = extractelement <4 x float> %5, i32 1
599 %8 = extractelement <4 x float> %6, i32 1
600 %9 = fsub float %8, %7
601 ret float %9
602 }
603
604 declare void @gfunc(<4 x float>*)
605 declare void @llvm.lifetime.start(i64, i8*)
606 declare void @llvm.lifetime.end(i64, i8*)