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 4 5--- 6name: ballot_sgpr_src 7legalized: true 8tracksRegLiveness: true 9body: | 10 bb.0: 11 liveins: $sgpr0 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 20 %1:_(s1) = G_TRUNC %0 21 %2:_(s64) = G_INTRINSIC intrinsic(@llvm.amdgcn.ballot), %1 22 S_ENDPGM 0, implicit %2 23... 24 25--- 26name: ballot_vgpr_src 27legalized: true 28tracksRegLiveness: true 29body: | 30 bb.0: 31 liveins: $vgpr0 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 40 %1:_(s1) = G_TRUNC %0 41 %2:_(s64) = G_INTRINSIC intrinsic(@llvm.amdgcn.ballot), %1 42 S_ENDPGM 0, implicit %2 43... 44 45--- 46name: ballot_vcc_src 47legalized: true 48tracksRegLiveness: true 49body: | 50 bb.0: 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 64... 65