Stanislav Mekhanoshin | 0ff7c83 | 2018-11-16 23:13:38 +0000 | [diff] [blame^] | 1 | ; 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 |
| 8 | define 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 |
| 19 | define 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 | |
| 25 | declare float @llvm.amdgcn.rcp.f32(float) |