|
1 |
| -// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -disable-llvm-passes -S -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,CHECK-UNOPT %s |
2 |
| -// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -S -emit-llvm %s -o - | FileCheck %s |
3 |
| - |
4 |
| -// CHECK: [[WGLOCALMEM_1:@WGLocalMem.*]] = internal addrspace(3) global [8 x i8] undef, align 8 |
5 |
| -// CHECK: [[WGLOCALMEM_2:@WGLocalMem.*]] = internal addrspace(3) global [4 x i8] undef, align 4 |
6 |
| -// CHECK: [[WGLOCALMEM_3:@WGLocalMem.*]] = internal addrspace(3) global [128 x i8] undef, align 4 |
7 |
| - |
8 |
| -// CHECK-NOT: __sycl_allocateLocalMemory |
9 |
| - |
10 |
| -#include "Inputs/sycl.hpp" |
11 |
| - |
12 |
| -constexpr size_t WgSize = 32; |
13 |
| -constexpr size_t WgCount = 4; |
14 |
| -constexpr size_t Size = WgSize * WgCount; |
15 |
| - |
16 |
| -class KernelA; |
17 |
| -class KernelB; |
18 |
| - |
19 |
| -using namespace cl::sycl; |
20 |
| - |
21 |
| -int main() { |
22 |
| - queue Q; |
23 |
| - { |
24 |
| - Q.submit([&](handler &cgh) { |
25 |
| - cgh.parallel_for<KernelA>( |
26 |
| - range<1>(Size), [=](item<1> Item) { |
27 |
| - auto *Ptr1 = group_local_memory<long>(); |
28 |
| - // CHECK-UNOPT: i8 addrspace(3)* getelementptr inbounds ([8 x i8], [8 x i8] addrspace(3)* [[WGLOCALMEM_1]], i32 0, i32 0) |
29 |
| - auto *Ptr2 = group_local_memory<float>(); |
30 |
| - // CHECK-UNOPT: i8 addrspace(3)* getelementptr inbounds ([4 x i8], [4 x i8] addrspace(3)* [[WGLOCALMEM_2]], i32 0, i32 0) |
31 |
| - }); |
32 |
| - }); |
33 |
| - } |
34 |
| - |
35 |
| - { |
36 |
| - Q.submit([&](handler &cgh) { |
37 |
| - cgh.parallel_for<KernelB>( |
38 |
| - range<1>(Size), [=](item<1> Item) { |
39 |
| - auto *Ptr3 = group_local_memory<int[WgSize]>(); |
40 |
| - // CHECK-UNOPT: i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* [[WGLOCALMEM_3]], i32 0, i32 0) |
41 |
| - }); |
42 |
| - }); |
43 |
| - } |
44 |
| -} |
| 1 | +// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice \ |
| 2 | +// RUN: -S -emit-llvm -mllvm -debug-pass=Structure -disable-llvm-passes \ |
| 3 | +// RUN: -o - %s 2>&1 | FileCheck %s |
| 4 | +// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice \ |
| 5 | +// RUN: -S -emit-llvm -mllvm -debug-pass=Structure -o - %s 2>&1 \ |
| 6 | +// RUN: | FileCheck %s |
| 7 | + |
| 8 | +// CHECK: Replace __sycl_allocateLocalMemory with allocation of memory in local address space |
0 commit comments