1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+popcnt -run-pass=legalizer %s -o - | FileCheck %s
4 # test popcount for s16, s32, and s64
10 regBankSelected: false
12 - { id: 0, class: _, preferred-register: '' }
13 - { id: 1, class: _, preferred-register: '' }
16 ; CHECK-LABEL: name: test_ctpop35
17 ; CHECK: [[DEF:%[0-9]+]]:_(s35) = IMPLICIT_DEF
18 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[DEF]](s35)
19 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s64) = G_CTPOP [[ZEXT]](s64)
20 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s35) = G_TRUNC [[CTPOP]](s64)
21 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s35) = COPY [[TRUNC]](s35)
22 ; CHECK-NEXT: RET 0, implicit [[COPY]](s35)
23 %0:_(s35) = IMPLICIT_DEF
24 %1:_(s35) = G_CTPOP %0
25 %2:_(s35) = COPY %1(s35)
33 regBankSelected: false
35 - { id: 0, class: _, preferred-register: '' }
36 - { id: 1, class: _, preferred-register: '' }
39 ; CHECK-LABEL: name: test_ctpop8
40 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = IMPLICIT_DEF
41 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s16) = G_ZEXT [[DEF]](s8)
42 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s16) = G_CTPOP [[ZEXT]](s16)
43 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[CTPOP]](s16)
44 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s8) = COPY [[TRUNC]](s8)
45 ; CHECK-NEXT: RET 0, implicit [[COPY]](s8)
46 %0:_(s8) = IMPLICIT_DEF
48 %2:_(s8) = COPY %1(s8)
56 regBankSelected: false
58 - { id: 0, class: _, preferred-register: '' }
59 - { id: 1, class: _, preferred-register: '' }
62 ; CHECK-LABEL: name: test_ctpop64
63 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = IMPLICIT_DEF
64 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s64) = G_CTPOP [[DEF]](s64)
65 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY [[CTPOP]](s64)
66 ; CHECK-NEXT: RET 0, implicit [[COPY]](s64)
67 %0:_(s64) = IMPLICIT_DEF
68 %1:_(s64) = G_CTPOP %0
69 %2:_(s64) = COPY %1(s64)
77 regBankSelected: false
79 - { id: 0, class: _, preferred-register: '' }
80 - { id: 1, class: _, preferred-register: '' }
83 ; CHECK-LABEL: name: test_ctpop32
84 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
85 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s32) = G_CTPOP [[DEF]](s32)
86 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY [[CTPOP]](s32)
87 ; CHECK-NEXT: RET 0, implicit [[COPY]](s32)
88 %0:_(s32) = IMPLICIT_DEF
89 %1:_(s32) = G_CTPOP %0
90 %2:_(s32) = COPY %1(s32)
98 regBankSelected: false
100 - { id: 0, class: _, preferred-register: '' }
101 - { id: 1, class: _, preferred-register: '' }
104 ; CHECK-LABEL: name: test_ctpop16
105 ; CHECK: [[DEF:%[0-9]+]]:_(s16) = IMPLICIT_DEF
106 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s16) = G_CTPOP [[DEF]](s16)
107 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY [[CTPOP]](s16)
108 ; CHECK-NEXT: RET 0, implicit [[COPY]](s16)
109 %0:_(s16) = IMPLICIT_DEF
110 %1:_(s16) = G_CTPOP %0
111 %2:_(s16) = COPY %1(s16)