bitcount.ll
4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -constprop -S | FileCheck %s
declare i31 @llvm.ctpop.i31(i31 %val)
declare i32 @llvm.cttz.i32(i32 %val, i1)
declare i33 @llvm.ctlz.i33(i33 %val, i1)
declare <2 x i31> @llvm.ctpop.v2i31(<2 x i31> %val)
declare <2 x i32> @llvm.cttz.v2i32(<2 x i32> %val, i1)
declare <2 x i33> @llvm.ctlz.v2i33(<2 x i33> %val, i1)
define i31 @ctpop_const() {
; CHECK-LABEL: @ctpop_const(
; CHECK-NEXT: ret i31 12
;
%x = call i31 @llvm.ctpop.i31(i31 12415124)
ret i31 %x
}
define i32 @cttz_const() {
; CHECK-LABEL: @cttz_const(
; CHECK-NEXT: ret i32 1
;
%x = call i32 @llvm.cttz.i32(i32 87359874, i1 true)
ret i32 %x
}
define i33 @ctlz_const() {
; CHECK-LABEL: @ctlz_const(
; CHECK-NEXT: ret i33 6
;
%x = call i33 @llvm.ctlz.i33(i33 87359874, i1 true)
ret i33 %x
}
define i31 @ctpop_zero() {
; CHECK-LABEL: @ctpop_zero(
; CHECK-NEXT: ret i31 0
;
%x = call i31 @llvm.ctpop.i31(i31 0)
ret i31 %x
}
define i32 @cttz_zero_defined() {
; CHECK-LABEL: @cttz_zero_defined(
; CHECK-NEXT: ret i32 32
;
%x = call i32 @llvm.cttz.i32(i32 0, i1 false)
ret i32 %x
}
define i32 @cttz_zero_undefined() {
; CHECK-LABEL: @cttz_zero_undefined(
; CHECK-NEXT: ret i32 undef
;
%x = call i32 @llvm.cttz.i32(i32 0, i1 true)
ret i32 %x
}
define i33 @ctlz_zero_defined() {
; CHECK-LABEL: @ctlz_zero_defined(
; CHECK-NEXT: ret i33 33
;
%x = call i33 @llvm.ctlz.i33(i33 0, i1 false)
ret i33 %x
}
define i33 @ctlz_zero_undefined() {
; CHECK-LABEL: @ctlz_zero_undefined(
; CHECK-NEXT: ret i33 undef
;
%x = call i33 @llvm.ctlz.i33(i33 0, i1 true)
ret i33 %x
}
define i31 @ctpop_undef() {
; CHECK-LABEL: @ctpop_undef(
; CHECK-NEXT: ret i31 0
;
%x = call i31 @llvm.ctpop.i31(i31 undef)
ret i31 %x
}
define i32 @cttz_undef_defined() {
; CHECK-LABEL: @cttz_undef_defined(
; CHECK-NEXT: ret i32 0
;
%x = call i32 @llvm.cttz.i32(i32 undef, i1 false)
ret i32 %x
}
define i32 @cttz_undef_undefined() {
; CHECK-LABEL: @cttz_undef_undefined(
; CHECK-NEXT: ret i32 undef
;
%x = call i32 @llvm.cttz.i32(i32 undef, i1 true)
ret i32 %x
}
define i33 @ctlz_undef_defined() {
; CHECK-LABEL: @ctlz_undef_defined(
; CHECK-NEXT: ret i33 0
;
%x = call i33 @llvm.ctlz.i33(i33 undef, i1 false)
ret i33 %x
}
define i33 @ctlz_undef_undefined() {
; CHECK-LABEL: @ctlz_undef_undefined(
; CHECK-NEXT: ret i33 undef
;
%x = call i33 @llvm.ctlz.i33(i33 undef, i1 true)
ret i33 %x
}
define <2 x i31> @ctpop_vector() {
; CHECK-LABEL: @ctpop_vector(
; CHECK-NEXT: ret <2 x i31> <i31 8, i31 1>
;
%x = call <2 x i31> @llvm.ctpop.v2i31(<2 x i31> <i31 255, i31 16>)
ret <2 x i31> %x
}
define <2 x i31> @ctpop_vector_undef() {
; CHECK-LABEL: @ctpop_vector_undef(
; CHECK-NEXT: ret <2 x i31> zeroinitializer
;
%x = call <2 x i31> @llvm.ctpop.v2i31(<2 x i31> <i31 0, i31 undef>)
ret <2 x i31> %x
}
define <2 x i32> @cttz_vector() {
; CHECK-LABEL: @cttz_vector(
; CHECK-NEXT: ret <2 x i32> <i32 0, i32 4>
;
%x = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> <i32 255, i32 16>, i1 true)
ret <2 x i32> %x
}
define <2 x i32> @cttz_vector_undef_defined() {
; CHECK-LABEL: @cttz_vector_undef_defined(
; CHECK-NEXT: ret <2 x i32> <i32 32, i32 0>
;
%x = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> <i32 0, i32 undef>, i1 false)
ret <2 x i32> %x
}
define <2 x i32> @cttz_vector_undef_undefined() {
; CHECK-LABEL: @cttz_vector_undef_undefined(
; CHECK-NEXT: ret <2 x i32> undef
;
%x = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> <i32 0, i32 undef>, i1 true)
ret <2 x i32> %x
}
define <2 x i33> @ctlz_vector() {
; CHECK-LABEL: @ctlz_vector(
; CHECK-NEXT: ret <2 x i33> <i33 25, i33 28>
;
%x = call <2 x i33> @llvm.ctlz.v2i33(<2 x i33> <i33 255, i33 16>, i1 true)
ret <2 x i33> %x
}
define <2 x i33> @ctlz_vector_undef_defined() {
; CHECK-LABEL: @ctlz_vector_undef_defined(
; CHECK-NEXT: ret <2 x i33> <i33 33, i33 0>
;
%x = call <2 x i33> @llvm.ctlz.v2i33(<2 x i33> <i33 0, i33 undef>, i1 false)
ret <2 x i33> %x
}
define <2 x i33> @ctlz_vector_undef_undefined() {
; CHECK-LABEL: @ctlz_vector_undef_undefined(
; CHECK-NEXT: ret <2 x i33> undef
;
%x = call <2 x i33> @llvm.ctlz.v2i33(<2 x i33> <i33 0, i33 undef>, i1 true)
ret <2 x i33> %x
}