1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect -regbankselect-fast -verify-machineinstrs -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect -regbankselect-greedy -verify-machineinstrs -o - %s | FileCheck %s
8 tracksRegLiveness: true
12 ; CHECK-LABEL: name: ballot_sgpr_src
13 ; CHECK: liveins: $sgpr0
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
17 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
18 ; CHECK-NEXT: [[INT:%[0-9]+]]:sgpr(s64) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.ballot), [[COPY1]](s1)
19 ; CHECK-NEXT: S_ENDPGM 0, implicit [[INT]](s64)
20 %0:_(s32) = COPY $sgpr0
22 %2:_(s64) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.ballot), %1
23 S_ENDPGM 0, implicit %2
29 tracksRegLiveness: true
33 ; CHECK-LABEL: name: ballot_vgpr_src
34 ; CHECK: liveins: $vgpr0
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
37 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
38 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
39 ; CHECK-NEXT: [[INT:%[0-9]+]]:sgpr(s64) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.ballot), [[COPY1]](s1)
40 ; CHECK-NEXT: S_ENDPGM 0, implicit [[INT]](s64)
41 %0:_(s32) = COPY $vgpr0
43 %2:_(s64) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.ballot), %1
44 S_ENDPGM 0, implicit %2
50 tracksRegLiveness: true
53 liveins: $vgpr0, $vgpr1
54 ; CHECK-LABEL: name: ballot_vcc_src
55 ; CHECK: liveins: $vgpr0, $vgpr1
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
58 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
59 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
60 ; CHECK-NEXT: [[INT:%[0-9]+]]:sgpr(s64) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.ballot), [[ICMP]](s1)
61 ; CHECK-NEXT: S_ENDPGM 0, implicit [[INT]](s64)
62 %0:_(s32) = COPY $vgpr0
63 %1:_(s32) = COPY $vgpr1
64 %2:_(s1) = G_ICMP intpred(eq), %0, %1
65 %3:_(s64) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.ballot), %2
66 S_ENDPGM 0, implicit %3