blob: 5dc6f64366c2110fccc1688ff6257e8b27d8b690 [file] [log] [blame]
Stanislav Mekhanoshin0ff7c832018-11-16 23:13:38 +00001; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefix=GCN %s
2
3; GCN-LABEL: {{^}}select_undef_lhs:
4; GCN: s_waitcnt
5; GCN-NOT: v_cmp
6; GCN-NOT: v_cndmask
7; GCN-NEXT: s_setpc_b64
8define float @select_undef_lhs(float %val, i1 %cond) {
9 %undef = call float @llvm.amdgcn.rcp.f32(float undef)
10 %sel = select i1 %cond, float %undef, float %val
11 ret float %sel
12}
13
14; GCN-LABEL: {{^}}select_undef_rhs:
15; GCN: s_waitcnt
16; GCN-NOT: v_cmp
17; GCN-NOT: v_cndmask
18; GCN-NEXT: s_setpc_b64
19define float @select_undef_rhs(float %val, i1 %cond) {
20 %undef = call float @llvm.amdgcn.rcp.f32(float undef)
21 %sel = select i1 %cond, float %val, float %undef
22 ret float %sel
23}
24
25declare float @llvm.amdgcn.rcp.f32(float)