1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -mtriple=i386-linux-gnu -mattr=+popcnt -run-pass=legalizer %s -o - | FileCheck %s
4 # test popcount for s8, s16, and s32
10 regBankSelected: false
12 - { id: 0, class: _, preferred-register: '' }
13 - { id: 1, class: _, preferred-register: '' }
16 ; CHECK-LABEL: name: test_ctpop8
17 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = IMPLICIT_DEF
18 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s16) = G_ZEXT [[DEF]](s8)
19 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s16) = G_CTPOP [[ZEXT]](s16)
20 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[CTPOP]](s16)
21 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s8) = COPY [[TRUNC]](s8)
22 ; CHECK-NEXT: RET 0, implicit [[COPY]](s8)
23 %0:_(s8) = IMPLICIT_DEF
25 %2:_(s8) = COPY %1(s8)
33 regBankSelected: false
35 - { id: 0, class: _, preferred-register: '' }
36 - { id: 1, class: _, preferred-register: '' }
39 ; CHECK-LABEL: name: test_ctpop32
40 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
41 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s32) = G_CTPOP [[DEF]](s32)
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY [[CTPOP]](s32)
43 ; CHECK-NEXT: RET 0, implicit [[COPY]](s32)
44 %0:_(s32) = IMPLICIT_DEF
45 %1:_(s32) = G_CTPOP %0
46 %2:_(s32) = COPY %1(s32)
54 regBankSelected: false
56 - { id: 0, class: _, preferred-register: '' }
57 - { id: 1, class: _, preferred-register: '' }
60 ; CHECK-LABEL: name: test_ctpop16
61 ; CHECK: [[DEF:%[0-9]+]]:_(s16) = IMPLICIT_DEF
62 ; CHECK-NEXT: [[CTPOP:%[0-9]+]]:_(s16) = G_CTPOP [[DEF]](s16)
63 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY [[CTPOP]](s16)
64 ; CHECK-NEXT: RET 0, implicit [[COPY]](s16)
65 %0:_(s16) = IMPLICIT_DEF
66 %1:_(s16) = G_CTPOP %0
67 %2:_(s16) = COPY %1(s16)