annotate llvm/test/CodeGen/AMDGPU/opencl-printf.ll @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: opt -mtriple=r600-- -amdgpu-printf-runtime-binding -mcpu=r600 -S < %s | FileCheck --check-prefix=FUNC --check-prefix=R600 %s
anatofuz
parents:
diff changeset
2 ; RUN: opt -mtriple=amdgcn-- -amdgpu-printf-runtime-binding -mcpu=fiji -S < %s | FileCheck --check-prefix=FUNC --check-prefix=GCN %s
anatofuz
parents:
diff changeset
3 ; RUN: opt -mtriple=amdgcn--amdhsa -amdgpu-printf-runtime-binding -mcpu=fiji -S < %s | FileCheck --check-prefix=FUNC --check-prefix=GCN %s
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 ; RUN: opt -mtriple=amdgcn--amdhsa -passes=amdgpu-printf-runtime-binding -mcpu=fiji -S < %s | FileCheck --check-prefix=FUNC --check-prefix=GCN %s
150
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 ; FUNC-LABEL: @test_kernel(
anatofuz
parents:
diff changeset
7 ; R600-LABEL: entry
anatofuz
parents:
diff changeset
8 ; R600-NOT: call i8 addrspace(1)* @__printf_alloc
anatofuz
parents:
diff changeset
9 ; R600: call i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(2)* @.str, i32 0, i32 0), i8* %arraydecay, i32 %n)
anatofuz
parents:
diff changeset
10 ; GCN-LABEL: entry
anatofuz
parents:
diff changeset
11 ; GCN: call i8 addrspace(1)* @__printf_alloc
anatofuz
parents:
diff changeset
12 ; GCN-LABEL: entry.split
anatofuz
parents:
diff changeset
13 ; GCN: icmp ne i8 addrspace(1)* %printf_alloc_fn, null
anatofuz
parents:
diff changeset
14 ; GCN: %PrintBuffID = getelementptr i8, i8 addrspace(1)* %printf_alloc_fn, i32 0
anatofuz
parents:
diff changeset
15 ; GCN: %PrintBuffIdCast = bitcast i8 addrspace(1)* %PrintBuffID to i32 addrspace(1)*
anatofuz
parents:
diff changeset
16 ; GCN: store i32 1, i32 addrspace(1)* %PrintBuffIdCast
anatofuz
parents:
diff changeset
17 ; GCN: %PrintBuffGep = getelementptr i8, i8 addrspace(1)* %printf_alloc_fn, i32 4
anatofuz
parents:
diff changeset
18 ; GCN: %PrintArgPtr = ptrtoint i8* %arraydecay to i64
anatofuz
parents:
diff changeset
19 ; GCN: %PrintBuffPtrCast = bitcast i8 addrspace(1)* %PrintBuffGep to i64 addrspace(1)*
anatofuz
parents:
diff changeset
20 ; GCN: store i64 %PrintArgPtr, i64 addrspace(1)* %PrintBuffPtrCast
anatofuz
parents:
diff changeset
21 ; GCN: %PrintBuffNextPtr = getelementptr i8, i8 addrspace(1)* %PrintBuffGep, i32 8
anatofuz
parents:
diff changeset
22 ; GCN: %PrintBuffPtrCast1 = bitcast i8 addrspace(1)* %PrintBuffNextPtr to i32 addrspace(1)*
anatofuz
parents:
diff changeset
23 ; GCN: store i32 %n, i32 addrspace(1)* %PrintBuffPtrCast1
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 @.str = private unnamed_addr addrspace(2) constant [6 x i8] c"%s:%d\00", align 1
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 define amdgpu_kernel void @test_kernel(i32 %n) {
anatofuz
parents:
diff changeset
28 entry:
anatofuz
parents:
diff changeset
29 %str = alloca [9 x i8], align 1
anatofuz
parents:
diff changeset
30 %arraydecay = getelementptr inbounds [9 x i8], [9 x i8]* %str, i32 0, i32 0
anatofuz
parents:
diff changeset
31 %call1 = call i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(2)* @.str, i32 0, i32 0), i8* %arraydecay, i32 %n)
anatofuz
parents:
diff changeset
32 ret void
anatofuz
parents:
diff changeset
33 }
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 declare i32 @printf(i8 addrspace(2)*, ...)