1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+amx-int8 -mattr=+avx512f -verify-machineinstrs | FileCheck %s
4 @buf = dso_local global [1024 x i8] zeroinitializer, align 64
5 @buf2 = dso_local global [1024 x i8] zeroinitializer, align 64
7 define dso_local void @test_api(i32 %0, i16 signext %1, i16 signext %2) nounwind {
8 ; CHECK-LABEL: test_api:
10 ; CHECK-NEXT: subq $968, %rsp # imm = 0x3C8
11 ; CHECK-NEXT: vpxord %zmm0, %zmm0, %zmm0
12 ; CHECK-NEXT: vmovdqu64 %zmm0, -{{[0-9]+}}(%rsp)
13 ; CHECK-NEXT: movb $1, -{{[0-9]+}}(%rsp)
14 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
15 ; CHECK-NEXT: movb %sil, -{{[0-9]+}}(%rsp)
16 ; CHECK-NEXT: movw %si, -{{[0-9]+}}(%rsp)
17 ; CHECK-NEXT: movb %sil, -{{[0-9]+}}(%rsp)
18 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
19 ; CHECK-NEXT: movb %dl, -{{[0-9]+}}(%rsp)
20 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
21 ; CHECK-NEXT: movb %dl, -{{[0-9]+}}(%rsp)
22 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
23 ; CHECK-NEXT: movb %sil, -{{[0-9]+}}(%rsp)
24 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
25 ; CHECK-NEXT: movb %dl, -{{[0-9]+}}(%rsp)
26 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
27 ; CHECK-NEXT: movb %sil, -{{[0-9]+}}(%rsp)
28 ; CHECK-NEXT: movw %dx, -{{[0-9]+}}(%rsp)
29 ; CHECK-NEXT: movb %dl, -{{[0-9]+}}(%rsp)
30 ; CHECK-NEXT: ldtilecfg -{{[0-9]+}}(%rsp)
31 ; CHECK-NEXT: movl $buf, %r8d
32 ; CHECK-NEXT: movl $32, %eax
33 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm1
34 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm1
35 ; CHECK-NEXT: movabsq $64, %rcx
36 ; CHECK-NEXT: tilestored %tmm1, -64(%rsp,%rcx) # 1024-byte Folded Spill
37 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm3
38 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm4
39 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm2
40 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm5
41 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm0
42 ; CHECK-NEXT: testl %edi, %edi
43 ; CHECK-NEXT: je .LBB0_2
44 ; CHECK-NEXT: # %bb.1:
45 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm6
46 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm7
47 ; CHECK-NEXT: tileloadd (%r8,%rax), %tmm1
48 ; CHECK-NEXT: jmp .LBB0_3
49 ; CHECK-NEXT: .LBB0_2:
50 ; CHECK-NEXT: movl $buf2, %ecx
51 ; CHECK-NEXT: tileloadd (%rcx,%rax), %tmm6
52 ; CHECK-NEXT: tileloadd (%rcx,%rax), %tmm7
53 ; CHECK-NEXT: tileloadd (%rcx,%rax), %tmm1
54 ; CHECK-NEXT: .LBB0_3:
55 ; CHECK-NEXT: tdpbssd %tmm7, %tmm6, %tmm1
56 ; CHECK-NEXT: movabsq $64, %rax
57 ; CHECK-NEXT: tileloadd -64(%rsp,%rax), %tmm7 # 1024-byte Folded Reload
58 ; CHECK-NEXT: tdpbssd %tmm7, %tmm1, %tmm3
59 ; CHECK-NEXT: tdpbssd %tmm4, %tmm3, %tmm2
60 ; CHECK-NEXT: tdpbssd %tmm5, %tmm2, %tmm0
61 ; CHECK-NEXT: movl $buf, %eax
62 ; CHECK-NEXT: movl $32, %ecx
63 ; CHECK-NEXT: tilestored %tmm0, (%rax,%rcx)
64 ; CHECK-NEXT: addq $968, %rsp # imm = 0x3C8
65 ; CHECK-NEXT: tilerelease
66 ; CHECK-NEXT: vzeroupper
68 %4 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
69 %5 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
70 %6 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
71 %7 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %2, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
72 %8 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %2, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
73 %9 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %2, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
74 %10 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %2, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
75 %11 = icmp eq i32 %0, 0
76 br i1 %11, label %16, label %12
79 %13 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %1, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
80 %14 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
81 %15 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32)
85 %17 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %1, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf2, i64 0, i64 0), i64 32)
86 %18 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf2, i64 0, i64 0), i64 32)
87 %19 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %1, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf2, i64 0, i64 0), i64 32)
90 20: ; preds = %16, %12
91 %21 = phi x86_amx [ %17, %16 ], [ %13, %12 ]
92 %22 = phi x86_amx [ %18, %16 ], [ %14, %12 ]
93 %23 = phi x86_amx [ %19, %16 ], [ %15, %12 ]
94 %24 = tail call x86_amx @llvm.x86.tdpbssd.internal(i16 %1, i16 %2, i16 %1, x86_amx %23, x86_amx %21, x86_amx %22)
95 %25 = tail call x86_amx @llvm.x86.tdpbssd.internal(i16 %1, i16 %2, i16 %2, x86_amx %6, x86_amx %24, x86_amx %5)
96 %26 = tail call x86_amx @llvm.x86.tdpbssd.internal(i16 %1, i16 %2, i16 %2, x86_amx %8, x86_amx %25, x86_amx %7)
97 %27 = tail call x86_amx @llvm.x86.tdpbssd.internal(i16 %2, i16 %2, i16 %2, x86_amx %10, x86_amx %26, x86_amx %9)
98 tail call void @llvm.x86.tilestored64.internal(i16 %2, i16 %2, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 32, x86_amx %27)
102 declare x86_amx @llvm.x86.tileloadd64.internal(i16, i16, i8*, i64)
103 declare x86_amx @llvm.x86.tdpbssd.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)
104 declare void @llvm.x86.tilestored64.internal(i16, i16, i8*, i64, x86_amx)