blob: 595f632b493dc76bdbdf872c7068b0acd4306ccf [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
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +00007define amdgpu_gs void @kill_gs_const() {
Michel Danzer6f273c52014-02-27 01:47:02 +00008main_body:
Matt Arsenault3ea06332017-02-22 00:02:21 +00009 %tmp = icmp ule i32 0, 3
10 %tmp1 = select i1 %tmp, float 1.000000e+00, float -1.000000e+00
11 call void @llvm.AMDGPU.kill(float %tmp1)
12 %tmp2 = icmp ule i32 3, 0
13 %tmp3 = select i1 %tmp2, float 1.000000e+00, float -1.000000e+00
14 call void @llvm.AMDGPU.kill(float %tmp3)
Michel Danzer6f273c52014-02-27 01:47:02 +000015 ret void
16}
17
Tom Stellardaa798342015-05-01 03:44:09 +000018; SI-LABEL: {{^}}kill_vcc_implicit_def:
19; SI-NOT: v_cmp_gt_f32_e32 vcc,
20; SI: v_cmp_gt_f32_e64 [[CMP:s\[[0-9]+:[0-9]+\]]], 0, v{{[0-9]+}}
21; SI: v_cmpx_le_f32_e32 vcc, 0, v{{[0-9]+}}
22; SI: v_cndmask_b32_e64 v{{[0-9]+}}, 0, 1.0, [[CMP]]
Matt Arsenault3ea06332017-02-22 00:02:21 +000023define amdgpu_ps void @kill_vcc_implicit_def([6 x <16 x i8>] addrspace(2)* byval %arg, [17 x <16 x i8>] addrspace(2)* byval %arg1, [17 x <4 x i32>] addrspace(2)* byval %arg2, [34 x <8 x i32>] addrspace(2)* byval %arg3, float inreg %arg4, i32 inreg %arg5, <2 x i32> %arg6, <2 x i32> %arg7, <2 x i32> %arg8, <3 x i32> %arg9, <2 x i32> %arg10, <2 x i32> %arg11, <2 x i32> %arg12, float %arg13, float %arg14, float %arg15, float %arg16, float %arg17, float %arg18, i32 %arg19, float %arg20, float %arg21) {
Tom Stellardaa798342015-05-01 03:44:09 +000024entry:
Matt Arsenault3ea06332017-02-22 00:02:21 +000025 %tmp0 = fcmp olt float %arg13, 0.000000e+00
26 call void @llvm.AMDGPU.kill(float %arg14)
27 %tmp1 = select i1 %tmp0, float 1.000000e+00, float 0.000000e+00
28 call void @llvm.amdgcn.exp.f32(i32 1, i32 15, float %tmp1, float %tmp1, float %tmp1, float %tmp1, i1 true, i1 true) #0
Tom Stellardaa798342015-05-01 03:44:09 +000029 ret void
30}
31
Matt Arsenault3ea06332017-02-22 00:02:21 +000032declare void @llvm.AMDGPU.kill(float) #0
33declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #0
Michel Danzer6f273c52014-02-27 01:47:02 +000034
Matt Arsenault3ea06332017-02-22 00:02:21 +000035attributes #0 = { nounwind }