1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=znver1 | FileCheck %s
4 define win64cc void @opaque() {
11 ; We need xmm6 to be live from the loop header across all iterations of the loop.
12 ; We shouldn't clobber ymm6 inside the loop.
15 ; CHECK: # %bb.0: # %start
16 ; CHECK-NEXT: subq $584, %rsp # imm = 0x248
17 ; CHECK-NEXT: .cfi_def_cfa_offset 592
18 ; CHECK-NEXT: vmovaps {{.*#+}} xmm6 = [1010101010101010101,2020202020202020202]
19 ; CHECK-NEXT: xorl %esi, %esi
20 ; CHECK-NEXT: .p2align 4
21 ; CHECK-NEXT: .LBB1_1: # %fake-loop
22 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
23 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm0
24 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm1
25 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm7
26 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm2
27 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm3
28 ; CHECK-NEXT: vmovups %ymm0, {{[0-9]+}}(%rsp)
29 ; CHECK-NEXT: vmovups %ymm1, {{[0-9]+}}(%rsp)
30 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm1
31 ; CHECK-NEXT: vmovups %ymm3, {{[0-9]+}}(%rsp)
32 ; CHECK-NEXT: vmovups %ymm2, {{[0-9]+}}(%rsp)
33 ; CHECK-NEXT: vmovups %ymm7, {{[0-9]+}}(%rsp)
34 ; CHECK-NEXT: vmovups %ymm3, {{[0-9]+}}(%rsp)
35 ; CHECK-NEXT: vmovups %ymm2, {{[0-9]+}}(%rsp)
36 ; CHECK-NEXT: vmovups %ymm7, {{[0-9]+}}(%rsp)
37 ; CHECK-NEXT: vmovups %ymm1, {{[0-9]+}}(%rsp)
38 ; CHECK-NEXT: vmovups %ymm1, {{[0-9]+}}(%rsp)
39 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm5
40 ; CHECK-NEXT: vmovups {{[0-9]+}}(%rsp), %ymm4
41 ; CHECK-NEXT: vmovups %ymm5, {{[0-9]+}}(%rsp)
42 ; CHECK-NEXT: vmovups %ymm4, {{[0-9]+}}(%rsp)
43 ; CHECK-NEXT: vzeroupper
44 ; CHECK-NEXT: callq opaque@PLT
45 ; CHECK-NEXT: vmovaps %xmm6, {{[0-9]+}}(%rsp)
46 ; CHECK-NEXT: testb %sil, %sil
47 ; CHECK-NEXT: jne .LBB1_1
48 ; CHECK-NEXT: # %bb.2: # %exit
49 ; CHECK-NEXT: movabsq $1010101010101010101, %rcx # imm = 0xE04998456557EB5
50 ; CHECK-NEXT: xorl %eax, %eax
51 ; CHECK-NEXT: cmpq %rcx, {{[0-9]+}}(%rsp)
52 ; CHECK-NEXT: setne %al
53 ; CHECK-NEXT: negl %eax
54 ; CHECK-NEXT: addq $584, %rsp # imm = 0x248
55 ; CHECK-NEXT: .cfi_def_cfa_offset 8
58 %dummy0 = alloca [22 x i64], align 8
59 %dummy1 = alloca [22 x i64], align 8
60 %dummy2 = alloca [22 x i64], align 8
62 %data = alloca <2 x i64>, align 16
66 fake-loop: ; preds = %fake-loop, %start
67 %dummy0.cast = bitcast ptr %dummy0 to ptr
68 %dummy1.cast = bitcast ptr %dummy1 to ptr
69 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %dummy1.cast, ptr nonnull align 8 %dummy0.cast, i64 176, i1 false)
71 %dummy1.cast.copy = bitcast ptr %dummy1 to ptr
72 %dummy2.cast = bitcast ptr %dummy2 to ptr
73 call void @llvm.lifetime.start.p0(i64 176, ptr nonnull %dummy2.cast)
74 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %dummy2.cast, ptr nonnull align 8 %dummy1.cast.copy, i64 176, i1 false)
76 call win64cc void @opaque()
78 store <2 x i64> <i64 1010101010101010101, i64 2020202020202020202>, ptr %data, align 8
80 %opaque-false = icmp eq i8 0, 1
81 br i1 %opaque-false, label %fake-loop, label %exit
83 exit: ; preds = %fake-loop
84 %data.cast = bitcast ptr %data to ptr
85 %0 = load i64, ptr %data.cast, align 8
86 %1 = icmp eq i64 %0, 1010101010101010101
87 %2 = select i1 %1, i32 0, i32 -1
91 ; Function Attrs: argmemonly nounwind
92 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #0
94 ; Function Attrs: argmemonly nounwind
95 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
97 attributes #0 = { argmemonly nounwind }