1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck -check-prefix=WAVE64 %s
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -O0 -run-pass=legalizer %s -o - | FileCheck -check-prefix=WAVE32 %s
8 ; WAVE64-LABEL: name: legal_brcond_vcc
10 ; WAVE64: successors: %bb.1(0x80000000)
11 ; WAVE64: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; WAVE64: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
13 ; WAVE64: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
14 ; WAVE64: G_BRCOND [[ICMP]](s1), %bb.1
16 ; WAVE32-LABEL: name: legal_brcond_vcc
18 ; WAVE32: successors: %bb.1(0x80000000)
19 ; WAVE32: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
20 ; WAVE32: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
21 ; WAVE32: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
22 ; WAVE32: G_BRCOND [[ICMP]](s1), %bb.1
26 liveins: $vgpr0, $vgpr1
27 %0:_(s32) = COPY $vgpr0
28 %1:_(s32) = COPY $vgpr1
29 %2:_(s1) = G_ICMP intpred(ne), %0, %1
37 name: legal_brcond_scc
40 ; WAVE64-LABEL: name: legal_brcond_scc
42 ; WAVE64: successors: %bb.1(0x80000000)
43 ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
44 ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
45 ; WAVE64: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
46 ; WAVE64: G_BRCOND [[ICMP]](s1), %bb.1
48 ; WAVE32-LABEL: name: legal_brcond_scc
50 ; WAVE32: successors: %bb.1(0x80000000)
51 ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
52 ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
53 ; WAVE32: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
54 ; WAVE32: G_BRCOND [[ICMP]](s1), %bb.1
57 liveins: $sgpr0, $sgpr1
59 %0:sgpr(s32) = COPY $sgpr0
60 %1:sgpr(s32) = COPY $sgpr1
61 %2:scc(s1) = G_ICMP intpred(eq), %0, %1
71 ; WAVE64-LABEL: name: brcond_si_if
73 ; WAVE64: successors: %bb.1(0x80000000)
74 ; WAVE64: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
75 ; WAVE64: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
76 ; WAVE64: [[ICMP:%[0-9]+]]:sreg_64_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
77 ; WAVE64: [[SI_IF:%[0-9]+]]:sreg_64_xexec(s64) = SI_IF [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
79 ; WAVE32-LABEL: name: brcond_si_if
81 ; WAVE32: successors: %bb.1(0x80000000)
82 ; WAVE32: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
83 ; WAVE32: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
84 ; WAVE32: [[ICMP:%[0-9]+]]:sreg_32_xm0_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
85 ; WAVE32: [[SI_IF:%[0-9]+]]:sreg_32_xm0_xexec(s64) = SI_IF [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
89 liveins: $vgpr0, $vgpr1
90 %0:_(s32) = COPY $vgpr0
91 %1:_(s32) = COPY $vgpr1
92 %2:_(s1) = G_ICMP intpred(ne), %0, %1
93 %3:_(s1), %4:_(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.if), %2
102 ; WAVE64-LABEL: name: brcond_si_loop
104 ; WAVE64: successors: %bb.1(0x80000000)
105 ; WAVE64: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
106 ; WAVE64: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
107 ; WAVE64: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
108 ; WAVE64: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
110 ; WAVE32-LABEL: name: brcond_si_loop
112 ; WAVE32: successors: %bb.1(0x80000000)
113 ; WAVE32: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
114 ; WAVE32: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
115 ; WAVE32: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
116 ; WAVE32: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
120 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
121 %0:_(s32) = COPY $vgpr0
122 %1:_(s32) = COPY $vgpr1
123 %2:_(s64) = COPY $sgpr0_sgpr1
124 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2