forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathper-aspect-split-1.ll
More file actions
133 lines (113 loc) · 5.08 KB
/
per-aspect-split-1.ll
File metadata and controls
133 lines (113 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
; This test emulates two translation units with 3 kernels:
; TU0_kernel0 - 1st translation unit, no aspects used
; TU0_kernel1 - 1st translation unit, aspect 1 is used
; TU1_kernel2 - 2nd translation unit, no aspects used
; The test is intended to check that sycl-post-link correctly separates kernels
; that use aspects from kernels which doesn't use aspects regardless of device
; code split mode
; RUN: sycl-post-link -split=auto -symbols -S < %s -o %t.table
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-M0-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_2.ll --check-prefixes CHECK-M1-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_1.ll --check-prefixes CHECK-M2-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_0.sym --check-prefixes CHECK-M0-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_2.sym --check-prefixes CHECK-M1-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_1.sym --check-prefixes CHECK-M2-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: sycl-post-link -split=source -symbols -S < %s -o %t.table
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-M0-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_2.ll --check-prefixes CHECK-M1-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_1.ll --check-prefixes CHECK-M2-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_0.sym --check-prefixes CHECK-M0-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_2.sym --check-prefixes CHECK-M1-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_1.sym --check-prefixes CHECK-M2-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: sycl-post-link -split=kernel -symbols -S < %s -o %t.table
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-M0-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_1.ll --check-prefixes CHECK-M1-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_2.ll --check-prefixes CHECK-M2-IR \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_0.sym --check-prefixes CHECK-M0-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_1.sym --check-prefixes CHECK-M1-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; RUN: FileCheck %s -input-file=%t_2.sym --check-prefixes CHECK-M2-SYMS \
; RUN: --implicit-check-not kernel0 --implicit-check-not kernel1
; Regardless of device code split mode, each kernel should go into a separate
; device image
; CHECK-M2-IR: define {{.*}} @TU0_kernel0
; CHECK-M2-SYMS: TU0_kernel0
; CHECK-M1-IR: define {{.*}} @TU0_kernel1
; CHECK-M1-SYMS: TU0_kernel1
; CHECK-M0-IR: define {{.*}} @TU1_kernel2
; CHECK-M0-SYMS: TU1_kernel2
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir64-unknown-linux"
; FIXME: device globals should also be properly distributed across device images
; if they are of optional type
@_ZL2GV = internal addrspace(1) constant [1 x i32] [i32 42], align 4
define dso_local spir_kernel void @TU0_kernel0() #0 {
entry:
call spir_func void @foo()
ret void
}
define dso_local spir_func void @foo() {
entry:
%a = alloca i32, align 4
%call = call spir_func i32 @bar(i32 1)
%add = add nsw i32 2, %call
store i32 %add, i32* %a, align 4
ret void
}
; Function Attrs: nounwind
define linkonce_odr dso_local spir_func i32 @bar(i32 %arg) {
entry:
%arg.addr = alloca i32, align 4
store i32 %arg, i32* %arg.addr, align 4
%0 = load i32, i32* %arg.addr, align 4
ret i32 %0
}
define dso_local spir_kernel void @TU0_kernel1() #0 !sycl_used_aspects !2 {
entry:
call spir_func void @foo1()
ret void
}
; Function Attrs: nounwind
define dso_local spir_func void @foo1() {
entry:
%a = alloca i32, align 4
store i32 2, i32* %a, align 4
ret void
}
define dso_local spir_kernel void @TU1_kernel2() #1 {
entry:
call spir_func void @foo2()
ret void
}
; Function Attrs: nounwind
define dso_local spir_func void @foo2() {
entry:
%a = alloca i32, align 4
%0 = load i32, i32 addrspace(4)* getelementptr inbounds ([1 x i32], [1 x i32] addrspace(4)* addrspacecast ([1 x i32] addrspace(1)* @_ZL2GV to [1 x i32] addrspace(4)*), i64 0, i64 0), align 4
%add = add nsw i32 4, %0
store i32 %add, i32* %a, align 4
ret void
}
attributes #0 = { "sycl-module-id"="TU1.cpp" }
attributes #1 = { "sycl-module-id"="TU2.cpp" }
!opencl.spir.version = !{!0, !0}
!spirv.Source = !{!1, !1}
!0 = !{i32 1, i32 2}
!1 = !{i32 4, i32 100000}
!2 = !{i32 1}