blob: 59997d27683d98eda76162e562c9d4e695061e4b [file] [log] [blame]
Tom Stellard49f8bfd2015-01-06 18:00:21 +00001; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
Marek Olsak75170772015-01-27 17:27:15 +00002; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
Michel Danzer6f273c52014-02-27 01:47:02 +00003
Tom Stellard79243d92014-10-01 17:15:17 +00004; SI-LABEL: {{^}}kill_gs_const:
Tom Stellard326d6ec2014-11-05 14:50:53 +00005; SI-NOT: v_cmpx_le_f32
6; SI: s_mov_b64 exec, 0
Michel Danzer6f273c52014-02-27 01:47:02 +00007
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +00008define amdgpu_gs void @kill_gs_const() {
Michel Danzer6f273c52014-02-27 01:47:02 +00009main_body:
10 %0 = icmp ule i32 0, 3
11 %1 = select i1 %0, float 1.000000e+00, float -1.000000e+00
12 call void @llvm.AMDGPU.kill(float %1)
Michel Danzer9e61c4b2014-02-27 01:47:09 +000013 %2 = icmp ule i32 3, 0
14 %3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
15 call void @llvm.AMDGPU.kill(float %3)
Michel Danzer6f273c52014-02-27 01:47:02 +000016 ret void
17}
18
Tom Stellardaa798342015-05-01 03:44:09 +000019; SI-LABEL: {{^}}kill_vcc_implicit_def:
20; SI-NOT: v_cmp_gt_f32_e32 vcc,
21; SI: v_cmp_gt_f32_e64 [[CMP:s\[[0-9]+:[0-9]+\]]], 0, v{{[0-9]+}}
22; SI: v_cmpx_le_f32_e32 vcc, 0, v{{[0-9]+}}
23; SI: v_cndmask_b32_e64 v{{[0-9]+}}, 0, 1.0, [[CMP]]
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +000024define amdgpu_ps void @kill_vcc_implicit_def([6 x <16 x i8>] addrspace(2)* byval, [17 x <16 x i8>] addrspace(2)* byval, [17 x <4 x i32>] addrspace(2)* byval, [34 x <8 x i32>] addrspace(2)* byval, float inreg, i32 inreg, <2 x i32>, <2 x i32>, <2 x i32>, <3 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, float, float, float, float, float, float, i32, float, float) {
Tom Stellardaa798342015-05-01 03:44:09 +000025entry:
26 %tmp0 = fcmp olt float %13, 0.0
27 call void @llvm.AMDGPU.kill(float %14)
28 %tmp1 = select i1 %tmp0, float 1.0, float 0.0
29 call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 1, i32 1, float %tmp1, float %tmp1, float %tmp1, float %tmp1)
30 ret void
31}
32
Michel Danzer6f273c52014-02-27 01:47:02 +000033declare void @llvm.AMDGPU.kill(float)
Tom Stellardaa798342015-05-01 03:44:09 +000034declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
Michel Danzer6f273c52014-02-27 01:47:02 +000035
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000036!0 = !{!"const", null, i32 1}