source: icGREP/icgrep-devel/llvm-3.6.1.src/test/CodeGen/R600/loop-idiom.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: opt -basicaa -loop-idiom -S < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=R600 --check-prefix=FUNC %s
2; RUN: opt -basicaa -loop-idiom -S < %s -march=amdgcn -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
3; RUN: opt -basicaa -loop-idiom -S < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
4
5target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:32:32-p5:64:64-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
6target triple = "r600--"
7
8
9
10; Make sure loop-idiom doesn't create memcpy or memset.  There are no library
11; implementations of these for R600.
12
13; FUNC: @no_memcpy
14; R600-NOT: {{^}}llvm.memcpy
15; SI-NOT: {{^}}llvm.memcpy
16define void @no_memcpy(i8 addrspace(3)* %in, i32 %size) {
17entry:
18  %dest = alloca i8, i32 32
19  br label %for.body
20
21for.body:
22  %0 = phi i32 [0, %entry], [%4, %for.body]
23  %1 = getelementptr i8 addrspace(3)* %in, i32 %0
24  %2 = getelementptr i8* %dest, i32 %0
25  %3 = load i8 addrspace(3)* %1
26  store i8 %3, i8* %2
27  %4 = add i32 %0, 1
28  %5 = icmp eq i32 %4, %size
29  br i1 %5, label %for.end, label %for.body
30
31for.end:
32  ret void
33}
34
35; FUNC: @no_memset
36; R600-NOT: {{^}}llvm.memset
37; R600-NOT: {{^}}memset_pattern16:
38; SI-NOT: {{^}}llvm.memset
39; SI-NOT: {{^}}memset_pattern16:
40define void @no_memset(i32 %size) {
41entry:
42  %dest = alloca i8, i32 32
43  br label %for.body
44
45for.body:
46  %0 = phi i32 [0, %entry], [%2, %for.body]
47  %1 = getelementptr i8* %dest, i32 %0
48  store i8 0, i8* %1
49  %2 = add i32 %0, 1
50  %3 = icmp eq i32 %2, %size
51  br i1 %3, label %for.end, label %for.body
52
53for.end:
54  ret void
55}
Note: See TracBrowser for help on using the repository browser.