1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-- -run-pass=fastpretileconfig -o - %s | FileCheck %s
5 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-unknown"
8 @buf = dso_local global [1024 x i8] zeroinitializer, align 16
9 @buf2 = dso_local global [1024 x i8] zeroinitializer, align 16
11 define dso_local void @test_api(i32 %cond, i16 signext %row, i16 signext %col) local_unnamed_addr #0 {
13 %tobool.not = icmp eq i32 %cond, 0
14 br i1 %tobool.not, label %if.else, label %if.then
16 if.then: ; preds = %entry
17 %0 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %row, i16 8, ptr @buf, i64 32)
18 %1 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 8, i16 %col, ptr @buf, i64 32)
19 %2 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %row, i16 %col, ptr @buf, i64 32)
22 if.else: ; preds = %entry
23 %3 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %row, i16 8, ptr @buf2, i64 32)
24 %4 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 8, i16 %col, ptr @buf2, i64 32)
25 %5 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %row, i16 %col, ptr @buf2, i64 32)
28 if.end: ; preds = %if.else, %if.then
29 %a.sroa.1094.0.in = phi x86_amx [ %3, %if.else ], [ %0, %if.then ]
30 %b.sroa.1069.0.in = phi x86_amx [ %4, %if.else ], [ %1, %if.then ]
31 %c.sroa.1044.0.in = phi x86_amx [ %5, %if.else ], [ %2, %if.then ]
32 %6 = tail call x86_amx @llvm.x86.tdpbssd.internal(i16 %row, i16 %col, i16 8, x86_amx %c.sroa.1044.0.in, x86_amx %a.sroa.1094.0.in, x86_amx %b.sroa.1069.0.in)
33 tail call void @llvm.x86.tilestored64.internal(i16 %row, i16 %col, ptr @buf, i64 32, x86_amx %6)
37 declare x86_amx @llvm.x86.tileloadd64.internal(i16, i16, ptr, i64) #1
38 declare x86_amx @llvm.x86.tdpbssd.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx) #1
39 declare void @llvm.x86.tilestored64.internal(i16, i16, ptr, i64, x86_amx) #1
41 attributes #0 = { "target-features"="+amx-int8,+avx512f" }
42 attributes #1 = { nounwind "target-features"="+amx-int8,+avx512f" }
48 tracksRegLiveness: true
50 - { id: 0, class: tile }
51 - { id: 1, class: tile }
52 - { id: 2, class: tile }
53 - { id: 3, class: tile }
54 - { id: 4, class: tile }
55 - { id: 5, class: tile }
56 - { id: 6, class: tile }
57 - { id: 7, class: tile }
58 - { id: 8, class: tile }
59 - { id: 9, class: gr32 }
60 - { id: 10, class: gr32 }
61 - { id: 11, class: gr32 }
62 - { id: 12, class: gr16 }
63 - { id: 13, class: gr16 }
64 - { id: 14, class: gr64 }
65 - { id: 15, class: gr64_nosp }
66 - { id: 16, class: gr16 }
67 - { id: 17, class: gr64 }
68 - { id: 18, class: gr64_nosp }
69 - { id: 19, class: gr16 }
70 - { id: 20, class: gr16 }
71 - { id: 21, class: tile }
72 - { id: 22, class: gr64 }
73 - { id: 23, class: gr64_nosp }
75 - { reg: '$edi', virtual-reg: '%9' }
76 - { reg: '$esi', virtual-reg: '%10' }
77 - { reg: '$edx', virtual-reg: '%11' }
80 machineFunctionInfo: {}
82 ; CHECK-LABEL: name: test_api
84 ; CHECK-NEXT: successors: %bb.2(0x30000000), %bb.1(0x50000000)
85 ; CHECK-NEXT: liveins: $edi, $esi, $edx
87 ; CHECK-NEXT: [[AVX512_512_SET0_:%[0-9]+]]:vr512 = AVX512_512_SET0
88 ; CHECK-NEXT: VMOVUPSZmr %stack.3, 1, $noreg, 0, $noreg, [[AVX512_512_SET0_]] :: (store (s512) into %stack.3, align 4)
89 ; CHECK-NEXT: MOV8mi %stack.3, 1, $noreg, 0, $noreg, 1 :: (store (s512) into %stack.3, align 4)
90 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY killed $edx
91 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr32 = COPY killed $esi
92 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr32 = COPY killed $edi
93 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr16 = COPY killed [[COPY]].sub_16bit
94 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gr16 = COPY killed [[COPY1]].sub_16bit
95 ; CHECK-NEXT: TEST32rr killed [[COPY2]], [[COPY2]], implicit-def $eflags
96 ; CHECK-NEXT: JCC_1 %bb.2, 4, implicit killed $eflags
97 ; CHECK-NEXT: JMP_1 %bb.1
99 ; CHECK-NEXT: bb.1.if.then:
100 ; CHECK-NEXT: successors: %bb.3(0x80000000)
102 ; CHECK-NEXT: [[MOV32ri64_:%[0-9]+]]:gr64 = MOV32ri64 @buf
103 ; CHECK-NEXT: [[MOV32ri64_1:%[0-9]+]]:gr64_nosp = MOV32ri64 32
104 ; CHECK-NEXT: [[MOV16ri:%[0-9]+]]:gr16 = MOV16ri 8
105 ; CHECK-NEXT: PLDTILECFGV %stack.3, 1, $noreg, 0, $noreg, implicit-def $tmm0, implicit-def $tmm1, implicit-def $tmm2, implicit-def $tmm3, implicit-def $tmm4, implicit-def $tmm5, implicit-def $tmm6, implicit-def $tmm7 :: (load (s512) from %stack.3, align 4)
106 ; CHECK-NEXT: [[LEA64r:%[0-9]+]]:gr64_nosp = LEA64r %stack.2, 1, $noreg, 0, $noreg
107 ; CHECK-NEXT: [[PTILELOADDV:%[0-9]+]]:tile = PTILELOADDV [[COPY4]], [[MOV16ri]], [[MOV32ri64_]], 1, [[MOV32ri64_1]], 0, $noreg
108 ; CHECK-NEXT: [[MOV64ri:%[0-9]+]]:gr64_nosp = MOV64ri 64
109 ; CHECK-NEXT: TILESTORED %stack.2, 1, killed [[MOV64ri]], 0, $noreg, [[PTILELOADDV]] :: (store (s8192) into %stack.2)
110 ; CHECK-NEXT: [[LEA64r1:%[0-9]+]]:gr64_nosp = LEA64r %stack.1, 1, $noreg, 0, $noreg
111 ; CHECK-NEXT: [[PTILELOADDV1:%[0-9]+]]:tile = PTILELOADDV [[MOV16ri]], [[COPY3]], [[MOV32ri64_]], 1, [[MOV32ri64_1]], 0, $noreg
112 ; CHECK-NEXT: [[MOV64ri1:%[0-9]+]]:gr64_nosp = MOV64ri 64
113 ; CHECK-NEXT: TILESTORED %stack.1, 1, killed [[MOV64ri1]], 0, $noreg, [[PTILELOADDV1]] :: (store (s8192) into %stack.1)
114 ; CHECK-NEXT: [[LEA64r2:%[0-9]+]]:gr64_nosp = LEA64r %stack.0, 1, $noreg, 0, $noreg
115 ; CHECK-NEXT: [[PTILELOADDV2:%[0-9]+]]:tile = PTILELOADDV [[COPY4]], [[COPY3]], killed [[MOV32ri64_]], 1, killed [[MOV32ri64_1]], 0, $noreg
116 ; CHECK-NEXT: [[MOV64ri2:%[0-9]+]]:gr64_nosp = MOV64ri 64
117 ; CHECK-NEXT: TILESTORED %stack.0, 1, killed [[MOV64ri2]], 0, $noreg, [[PTILELOADDV2]] :: (store (s8192) into %stack.0)
118 ; CHECK-NEXT: JMP_1 %bb.3
120 ; CHECK-NEXT: bb.2.if.else:
121 ; CHECK-NEXT: successors: %bb.3(0x80000000)
123 ; CHECK-NEXT: [[MOV32ri64_2:%[0-9]+]]:gr64 = MOV32ri64 @buf2
124 ; CHECK-NEXT: [[MOV32ri64_3:%[0-9]+]]:gr64_nosp = MOV32ri64 32
125 ; CHECK-NEXT: [[MOV16ri1:%[0-9]+]]:gr16 = MOV16ri 8
126 ; CHECK-NEXT: PLDTILECFGV %stack.3, 1, $noreg, 0, $noreg, implicit-def $tmm0, implicit-def $tmm1, implicit-def $tmm2, implicit-def $tmm3, implicit-def $tmm4, implicit-def $tmm5, implicit-def $tmm6, implicit-def $tmm7 :: (load (s512) from %stack.3, align 4)
127 ; CHECK-NEXT: [[LEA64r3:%[0-9]+]]:gr64_nosp = LEA64r %stack.6, 1, $noreg, 0, $noreg
128 ; CHECK-NEXT: [[PTILELOADDV3:%[0-9]+]]:tile = PTILELOADDV [[COPY4]], [[MOV16ri1]], [[MOV32ri64_2]], 1, [[MOV32ri64_3]], 0, $noreg
129 ; CHECK-NEXT: [[MOV64ri3:%[0-9]+]]:gr64_nosp = MOV64ri 64
130 ; CHECK-NEXT: TILESTORED %stack.6, 1, killed [[MOV64ri3]], 0, $noreg, [[PTILELOADDV3]] :: (store (s8192) into %stack.6)
131 ; CHECK-NEXT: [[LEA64r4:%[0-9]+]]:gr64_nosp = LEA64r %stack.5, 1, $noreg, 0, $noreg
132 ; CHECK-NEXT: [[PTILELOADDV4:%[0-9]+]]:tile = PTILELOADDV [[MOV16ri1]], [[COPY3]], [[MOV32ri64_2]], 1, [[MOV32ri64_3]], 0, $noreg
133 ; CHECK-NEXT: [[MOV64ri4:%[0-9]+]]:gr64_nosp = MOV64ri 64
134 ; CHECK-NEXT: TILESTORED %stack.5, 1, killed [[MOV64ri4]], 0, $noreg, [[PTILELOADDV4]] :: (store (s8192) into %stack.5)
135 ; CHECK-NEXT: [[LEA64r5:%[0-9]+]]:gr64_nosp = LEA64r %stack.4, 1, $noreg, 0, $noreg
136 ; CHECK-NEXT: [[PTILELOADDV5:%[0-9]+]]:tile = PTILELOADDV [[COPY4]], [[COPY3]], killed [[MOV32ri64_2]], 1, killed [[MOV32ri64_3]], 0, $noreg
137 ; CHECK-NEXT: [[MOV64ri5:%[0-9]+]]:gr64_nosp = MOV64ri 64
138 ; CHECK-NEXT: TILESTORED %stack.4, 1, killed [[MOV64ri5]], 0, $noreg, [[PTILELOADDV5]] :: (store (s8192) into %stack.4)
140 ; CHECK-NEXT: bb.3.if.end:
141 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gr16 = PHI [[MOV16ri]], %bb.1, [[MOV16ri1]], %bb.2
142 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:gr16 = PHI [[COPY4]], %bb.1, [[COPY4]], %bb.2
143 ; CHECK-NEXT: [[PHI2:%[0-9]+]]:gr64_nosp = PHI [[LEA64r]], %bb.1, [[LEA64r3]], %bb.2
144 ; CHECK-NEXT: [[PHI3:%[0-9]+]]:gr16 = PHI [[COPY3]], %bb.1, [[COPY3]], %bb.2
145 ; CHECK-NEXT: [[PHI4:%[0-9]+]]:gr16 = PHI [[MOV16ri]], %bb.1, [[MOV16ri1]], %bb.2
146 ; CHECK-NEXT: [[PHI5:%[0-9]+]]:gr64_nosp = PHI [[LEA64r1]], %bb.1, [[LEA64r4]], %bb.2
147 ; CHECK-NEXT: [[PHI6:%[0-9]+]]:gr16 = PHI [[COPY3]], %bb.1, [[COPY3]], %bb.2
148 ; CHECK-NEXT: [[PHI7:%[0-9]+]]:gr16 = PHI [[COPY4]], %bb.1, [[COPY4]], %bb.2
149 ; CHECK-NEXT: [[PHI8:%[0-9]+]]:gr64_nosp = PHI [[LEA64r2]], %bb.1, [[LEA64r5]], %bb.2
150 ; CHECK-NEXT: PLDTILECFGV %stack.3, 1, $noreg, 0, $noreg, implicit-def $tmm0, implicit-def $tmm1, implicit-def $tmm2, implicit-def $tmm3, implicit-def $tmm4, implicit-def $tmm5, implicit-def $tmm6, implicit-def $tmm7 :: (load (s512) from %stack.3, align 4)
151 ; CHECK-NEXT: [[MOV64ri6:%[0-9]+]]:gr64_nosp = MOV64ri 64
152 ; CHECK-NEXT: [[PTILELOADDV6:%[0-9]+]]:tile = PTILELOADDV [[PHI1]], [[PHI]], [[PHI2]], 1, killed [[MOV64ri6]], 0, $noreg
153 ; CHECK-NEXT: [[MOV64ri7:%[0-9]+]]:gr64_nosp = MOV64ri 64
154 ; CHECK-NEXT: [[PTILELOADDV7:%[0-9]+]]:tile = PTILELOADDV [[PHI4]], [[PHI3]], [[PHI5]], 1, killed [[MOV64ri7]], 0, $noreg
155 ; CHECK-NEXT: [[MOV64ri8:%[0-9]+]]:gr64_nosp = MOV64ri 64
156 ; CHECK-NEXT: [[PTILELOADDV8:%[0-9]+]]:tile = PTILELOADDV [[PHI7]], [[PHI6]], [[PHI8]], 1, killed [[MOV64ri8]], 0, $noreg
157 ; CHECK-NEXT: [[MOV16ri2:%[0-9]+]]:gr16 = MOV16ri 8
158 ; CHECK-NEXT: [[PTDPBSSDV:%[0-9]+]]:tile = PTDPBSSDV [[COPY4]], [[COPY3]], killed [[MOV16ri2]], killed [[PTILELOADDV8]], killed [[PTILELOADDV6]], killed [[PTILELOADDV7]]
159 ; CHECK-NEXT: [[MOV32ri64_4:%[0-9]+]]:gr64 = MOV32ri64 @buf
160 ; CHECK-NEXT: [[MOV32ri64_5:%[0-9]+]]:gr64_nosp = MOV32ri64 32
161 ; CHECK-NEXT: PTILESTOREDV killed [[COPY4]], killed [[COPY3]], killed [[MOV32ri64_4]], 1, killed [[MOV32ri64_5]], 0, $noreg, killed [[PTDPBSSDV]]
164 successors: %bb.2(0x30000000), %bb.1(0x50000000)
165 liveins: $edi, $esi, $edx
168 %11:gr32 = COPY killed $edx
169 %10:gr32 = COPY killed $esi
170 %9:gr32 = COPY killed $edi
171 %13:gr16 = COPY killed %11.sub_16bit
172 %12:gr16 = COPY killed %10.sub_16bit
173 TEST32rr killed %9, %9, implicit-def $eflags
174 JCC_1 %bb.2, 4, implicit killed $eflags
178 %14:gr64 = MOV32ri64 @buf
179 %15:gr64_nosp = MOV32ri64 32
181 %0:tile = PTILELOADDV %12, %16, %14, 1, %15, 0, $noreg
182 %1:tile = PTILELOADDV killed %16, %13, %14, 1, %15, 0, $noreg
183 %2:tile = PTILELOADDV %12, %13, killed %14, 1, killed %15, 0, $noreg
187 %17:gr64 = MOV32ri64 @buf2
188 %18:gr64_nosp = MOV32ri64 32
190 %3:tile = PTILELOADDV %12, %19, %17, 1, %18, 0, $noreg
191 %4:tile = PTILELOADDV killed %19, %13, %17, 1, %18, 0, $noreg
192 %5:tile = PTILELOADDV %12, %13, killed %17, 1, killed %18, 0, $noreg
197 %6:tile = PHI %0, %bb.1, %3, %bb.2
198 %7:tile = PHI %1, %bb.1, %4, %bb.2
199 %8:tile = PHI %2, %bb.1, %5, %bb.2
201 %21:tile = PTDPBSSDV %12, %13, killed %20, killed %8, killed %6, killed %7
202 %22:gr64 = MOV32ri64 @buf
203 %23:gr64_nosp = MOV32ri64 32
204 PTILESTOREDV killed %12, killed %13, killed %22, 1, killed %23, 0, $noreg, killed %21