Skip to content

Commit eb20ee7

Browse files
garimaguvladimirlaz
authored andcommitted
[SYCL] Removal of dependence to llvm-spirv in clang lit-tests
Tests Changed: is_valid_event.cl - After edit, we check for the expected mangled name for a spirv function call. private-array-initialization.cl - After edit, we check for the expected IR generation by clang. Corresponding test is being added in KhronosGroup/SPIRV-LLVM-Translator project. spir-no-deref-attr.cpp - After edit, removed the test for clang. Corresponding test exists in spirv-llvm-translator project. Removed the dependency to llvm-spirv in CMake config file. Signed-off-by: Garima Gupta [email protected]
1 parent 8830ccc commit eb20ee7

File tree

4 files changed

+7
-57
lines changed

4 files changed

+7
-57
lines changed

clang/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ if( NOT CLANG_BUILT_STANDALONE )
112112
llvm-objdump
113113
llvm-profdata
114114
llvm-readobj
115-
llvm-spirv
116115
llvm-symbolizer
117116
opt
118117
)

clang/test/CodeGenSPIRV/intel/is_valid_event.cl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// Builtins must be declared as overloadable, so Clang mangles their names,
44
// and LLVM-SPIRV translator can recognize them.
55

6-
// RUN: %clang_cc1 %s -emit-llvm-bc -triple spir-unknown-unknown -O0 -cl-std=CL2.0 -include opencl-c.h -o %t.bc
7-
// RUN: llvm-spirv %t.bc -o %t.spv
8-
// RUN: llvm-spirv -to-text %t.spv -o - | FileCheck %s
6+
// RUN: %clang_cc1 %s -emit-llvm -triple spir-unknown-unknown -O0 -cl-std=CL2.0 -include opencl-c.h -o - | FileCheck %s
97

10-
// CHECK: CreateUserEvent
11-
// CHECK: IsValidEvent
12-
// CHECK-NOT: FunctionCall
8+
// CHECK: %[[CALL_USEREVENT:[a-z0-9]+]] = call spir_func %opencl.clk_event_t* @_Z17create_user_eventv()
9+
// CHECK: store %opencl.clk_event_t* %[[CALL_USEREVENT]], %opencl.clk_event_t** %e, align 4
10+
// CHECK: %[[VAR_EVENTPTR:[a-z0-9]+]] = load %opencl.clk_event_t*, %opencl.clk_event_t** %e, align 4
11+
// CHECK: %[[CALL_ISVALIDEVENT:[a-z0-9]+]] = call spir_func zeroext i1 @_Z14is_valid_event12ocl_clkevent(%opencl.clk_event_t* %[[VAR_EVENTPTR]])
12+
// CHECK: ret i1 %[[CALL_ISVALIDEVENT]]
1313

1414
bool test() {
1515
clk_event_t e = create_user_event();
Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,12 @@
11
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-LLVM
2-
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -emit-llvm-bc -o %t.bc
3-
// RUN: llvm-spirv %t.bc -o %t.spv
4-
// RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
52

63
// CHECK-LLVM: @__const.test.arr = private unnamed_addr addrspace(2) constant [3 x i32] [i32 1, i32 2, i32 3], align 4
74

8-
// CHECK-SPIRV-DAG: TypeInt [[i32:[0-9]+]] 32 0
9-
// CHECK-SPIRV-DAG: TypeInt [[i8:[0-9]+]] 8 0
10-
// CHECK-SPIRV-DAG: Constant [[i32]] [[one:[0-9]+]] 1
11-
// CHECK-SPIRV-DAG: Constant [[i32]] [[two:[0-9]+]] 2
12-
// CHECK-SPIRV-DAG: Constant [[i32]] [[three:[0-9]+]] 3
13-
// CHECK-SPIRV-DAG: Constant [[i32]] [[twelve:[0-9]+]] 12
14-
// CHECK-SPIRV-DAG: TypeArray [[i32x3:[0-9]+]] [[i32]] [[three]]
15-
// CHECK-SPIRV-DAG: TypePointer [[i32x3_ptr:[0-9]+]] 7 [[i32x3]]
16-
// CHECK-SPIRV-DAG: TypePointer [[const_i32x3_ptr:[0-9]+]] 0 [[i32x3]]
17-
// CHECK-SPIRV-DAG: TypePointer [[i8_ptr:[0-9]+]] 7 [[i8]]
18-
// CHECK-SPIRV-DAG: TypePointer [[const_i8_ptr:[0-9]+]] 0 [[i8]]
19-
// CHECK-SPIRV: ConstantComposite [[i32x3]] [[test_arr_init:[0-9]+]] [[one]] [[two]] [[three]]
20-
// CHECK-SPIRV: Variable [[const_i32x3_ptr]] [[test_arr:[0-9]+]] 0 [[test_arr_init]]
21-
// CHECK-SPIRV: Variable [[const_i32x3_ptr]] [[test_arr2:[0-9]+]] 0 [[test_arr_init]]
22-
235
void test() {
246
__private int arr[] = {1,2,3};
257
__private const int arr2[] = {1,2,3};
268
// CHECK-LLVM: %arr = alloca [3 x i32], align 4
279
// CHECK-LLVM: %[[arr_i8_ptr:[0-9]+]] = bitcast [3 x i32]* %arr to i8*
28-
// CHECK-LLVM: call void @llvm.memcpy.p0i8.p2i8.i32(i8* align 4 %0, i8 addrspace(2)* align 4 bitcast ([3 x i32] addrspace(2)* @__const.test.arr to i8 addrspace(2)*), i32 12, i1 false)
29-
30-
// CHECK-SPIRV: Variable [[i32x3_ptr]] [[arr:[0-9]+]] 7
31-
// CHECK-SPIRV: Variable [[i32x3_ptr]] [[arr2:[0-9]+]] 7
32-
33-
// CHECK-SPIRV: Bitcast [[i8_ptr]] [[arr_i8_ptr:[0-9]+]] [[arr]]
34-
// CHECK-SPIRV: Bitcast [[const_i8_ptr]] [[test_arr_const_i8_ptr:[0-9]+]] [[test_arr]]
35-
// CHECK-SPIRV: CopyMemorySized [[arr_i8_ptr]] [[test_arr_const_i8_ptr]] [[twelve]] 2 4
10+
// CHECK-LLVM: call void @llvm.memcpy.p0i8.p2i8.i32(i8* align 4 %[[arr_i8_ptr]], i8 addrspace(2)* align 4 bitcast ([3 x i32] addrspace(2)* @__const.test.arr to i8 addrspace(2)*), i32 12, i1 false)
3611

37-
// CHECK-SPIRV: Bitcast [[i8_ptr]] [[arr2_i8_ptr:[0-9]+]] [[arr2]]
38-
// CHECK-SPIRV: Bitcast [[const_i8_ptr]] [[test_arr2_const_i8_ptr:[0-9]+]] [[test_arr2]]
39-
// CHECK-SPIRV: CopyMemorySized [[arr2_i8_ptr]] [[test_arr2_const_i8_ptr]] [[twelve]] 2 4
4012
}

clang/test/CodeGenSYCL/spir-no-deref-attr.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)