source: icGREP/icgrep-devel/llvm-3.6.1.src/test/CodeGen/R600/select64.ll @ 4664

Last change on this file since 4664 was 4664, checked in by cameron, 4 years ago

Upgrade LLVM to 3.6.1

File size: 1.7 KB
Line 
1; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs | FileCheck %s
2; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s
3
4; CHECK-LABEL: {{^}}select0:
5; i64 select should be split into two i32 selects, and we shouldn't need
6; to use a shfit to extract the hi dword of the input.
7; CHECK-NOT: s_lshr_b64
8; CHECK: v_cndmask
9; CHECK: v_cndmask
10define void @select0(i64 addrspace(1)* %out, i32 %cond, i64 %in) {
11entry:
12  %0 = icmp ugt i32 %cond, 5
13  %1 = select i1 %0, i64 0, i64 %in
14  store i64 %1, i64 addrspace(1)* %out
15  ret void
16}
17
18; CHECK-LABEL: {{^}}select_trunc_i64:
19; CHECK: v_cndmask_b32
20; CHECK-NOT: v_cndmask_b32
21define void @select_trunc_i64(i32 addrspace(1)* %out, i32 %cond, i64 %in) nounwind {
22  %cmp = icmp ugt i32 %cond, 5
23  %sel = select i1 %cmp, i64 0, i64 %in
24  %trunc = trunc i64 %sel to i32
25  store i32 %trunc, i32 addrspace(1)* %out, align 4
26  ret void
27}
28
29; CHECK-LABEL: {{^}}select_trunc_i64_2:
30; CHECK: v_cndmask_b32
31; CHECK-NOT: v_cndmask_b32
32define void @select_trunc_i64_2(i32 addrspace(1)* %out, i32 %cond, i64 %a, i64 %b) nounwind {
33  %cmp = icmp ugt i32 %cond, 5
34  %sel = select i1 %cmp, i64 %a, i64 %b
35  %trunc = trunc i64 %sel to i32
36  store i32 %trunc, i32 addrspace(1)* %out, align 4
37  ret void
38}
39
40; CHECK-LABEL: {{^}}v_select_trunc_i64_2:
41; CHECK: v_cndmask_b32
42; CHECK-NOT: v_cndmask_b32
43define void @v_select_trunc_i64_2(i32 addrspace(1)* %out, i32 %cond, i64 addrspace(1)* %aptr, i64 addrspace(1)* %bptr) nounwind {
44  %cmp = icmp ugt i32 %cond, 5
45  %a = load i64 addrspace(1)* %aptr, align 8
46  %b = load i64 addrspace(1)* %bptr, align 8
47  %sel = select i1 %cmp, i64 %a, i64 %b
48  %trunc = trunc i64 %sel to i32
49  store i32 %trunc, i32 addrspace(1)* %out, align 4
50  ret void
51}
Note: See TracBrowser for help on using the repository browser.