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