annotate test/CodeGen/AMDGPU/setcc-sext.ll @ 146:3fc4d5c3e21e

set tail call flag for code segment in CGCAll
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:23:36 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; GCN-LABEL: {{^}}setcc_sgt_true_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 define amdgpu_kernel void @setcc_sgt_true_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 %cond = icmp sgt i32 %ext, -1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; GCN-LABEL: {{^}}setcc_sgt_true_sext_swap:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 define amdgpu_kernel void @setcc_sgt_true_sext_swap(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 %cond = icmp slt i32 -1, %ext
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; GCN-LABEL: {{^}}setcc_ne_true_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 define amdgpu_kernel void @setcc_ne_true_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 %cond = icmp ne i32 %ext, -1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 ; GCN-LABEL: {{^}}setcc_ult_true_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 define amdgpu_kernel void @setcc_ult_true_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 %cond = icmp ult i32 %ext, -1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 ; GCN-LABEL: {{^}}setcc_eq_true_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 ; GCN: v_cmp_gt_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 define amdgpu_kernel void @setcc_eq_true_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 %cond = icmp eq i32 %ext, -1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 ; GCN-LABEL: {{^}}setcc_sle_true_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 ; GCN: v_cmp_gt_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 define amdgpu_kernel void @setcc_sle_true_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 %cond = icmp sle i32 %ext, -1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 ; GCN-LABEL: {{^}}setcc_uge_true_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136 ; GCN: v_cmp_gt_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 define amdgpu_kernel void @setcc_uge_true_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 %cond = icmp uge i32 %ext, -1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 ; GCN-LABEL: {{^}}setcc_eq_false_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162 define amdgpu_kernel void @setcc_eq_false_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 %cond = icmp eq i32 %ext, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 ; GCN-LABEL: {{^}}setcc_sge_false_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184 define amdgpu_kernel void @setcc_sge_false_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190 %cond = icmp sge i32 %ext, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 ; GCN-LABEL: {{^}}setcc_ule_false_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202 ; GCN: v_cmp_le_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206 define amdgpu_kernel void @setcc_ule_false_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
210 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212 %cond = icmp ule i32 %ext, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 ; GCN-LABEL: {{^}}setcc_ne_false_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224 ; GCN: v_cmp_gt_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228 define amdgpu_kernel void @setcc_ne_false_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 %cond = icmp ne i32 %ext, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
242 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
243 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
244 ; GCN-LABEL: {{^}}setcc_ugt_false_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
245 ; GCN: v_cmp_gt_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
246 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
247 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
248
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
249 define amdgpu_kernel void @setcc_ugt_false_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
250 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
251 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
252 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
253 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
254 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
255 %cond = icmp ugt i32 %ext, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
256 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
257
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
258 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
259 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
260 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
261
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
262 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
263 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
264 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
265 ; GCN-LABEL: {{^}}setcc_slt_false_sext:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
266 ; GCN: v_cmp_gt_u32_e{{32|64}} [[CC:[^,]+]], v{{[0-9]+}}, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
267 ; GCN-NEXT: s_and_saveexec_b64 {{[^,]+}}, [[CC]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
268 ; GCN-NOT: v_cndmask_
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
269
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
270 define amdgpu_kernel void @setcc_slt_false_sext(i32 addrspace(1)* nocapture %arg) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
271 bb:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
272 %x = tail call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
273 %y = tail call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
274 %cmp = icmp ugt i32 %x, %y
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
275 %ext = sext i1 %cmp to i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
276 %cond = icmp slt i32 %ext, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
277 br i1 %cond, label %then, label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
278
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
279 then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
280 store i32 1, i32 addrspace(1)* %arg, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
281 br label %endif
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
282
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
283 endif:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
284 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
285 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
286
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
287
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
288 declare i32 @llvm.amdgcn.workitem.id.x() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
289
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
290 declare i32 @llvm.amdgcn.workitem.id.y() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
291
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
292 attributes #0 = { nounwind readnone speculatable }