Skip to content

[ESIMD] Don't invoke sycl-post-link in clang tests #3651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions clang/test/CodeGenSYCL/esimd-accessor-ptr-md.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
// TODO: previously code generation and ESIMD lowering was
// a part of the same %clang_cc1 invocation, but now it is
// separate. So, we can split this test into 2, where one
// will be testing code generation and the second ESIMD lowering.
//
// RUN: %clang_cc1 -fsycl-is-device \
// RUN: -internal-isystem %S/Inputs -triple spir64-unknown-unknown-sycldevice \
// RUN: -disable-llvm-passes -emit-llvm %s -o %t
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table
// RUN: FileCheck %s -input-file=%t_esimd_0.ll
// RUN: -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s

// This test checks
// 1) proper metadata generation for accessors used in ESIMD
// kernels:
// - Proper 'kernel_arg_accessor_ptr' metadata is generated by the FE for
// ESIMD kernels
// - Pointers originating from accessors are marked with 'buffer_t' and proper
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we just simply removing the checks from here w/o reproducing them elsewhere (e.g. in new LowerESIMD tests)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there are existing tests on LowerESIMD pass that check that. I mentioned this in the commit message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I see, thanks.

// argument kind.
// 1) Proper 'kernel_arg_accessor_ptr' metadata is generated by the FE for
// ESIMD kernels.
// 2) __init_esimd function is used to initialize the accessor rather than
// __init.

Expand All @@ -38,10 +27,6 @@ void test(int val) {

// --- Name
// CHECK-LABEL: define {{.*}}spir_kernel void @"_ZTSZZ4testiENK3$_0clERN2cl4sycl7handlerEE12esimd_kernel"(
// --- Signature
// CHECK: i32 addrspace(1)* "VCArgumentDesc"="buffer_t" "VCArgumentIOKind"="0" "VCArgumentKind"="2" %_arg_,
// CHECK: i32 "VCArgumentDesc" "VCArgumentIOKind"="0" "VCArgumentKind"="0" %_arg_1,
// CHECK: i32 addrspace(1)* "VCArgumentDesc"="buffer_t" "VCArgumentIOKind"="0" "VCArgumentKind"="2" %_arg_3)
// --- Attributes
// CHECK: {{.*}} !kernel_arg_accessor_ptr ![[ACC_PTR_ATTR:[0-9]+]] !sycl_explicit_simd !{{[0-9]+}} {{.*}}{
// --- init_esimd call is expected instead of __init:
Expand Down
15 changes: 4 additions & 11 deletions clang/test/CodeGenSYCL/esimd-private-global.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
// TODO: previously code generation and ESIMD lowering was
// a part of the same %clang_cc1 invocation, but now it is
// separate. So, we can split this test into 2, where one
// will be testing code generation and the second ESIMD lowering.
//
// RUN: %clang_cc1 -disable-llvm-passes -triple spir64-unknown-unknown-sycldevice \
// RUN: -fsycl-is-device -emit-llvm %s -o %t
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table
// RUN: FileCheck %s -input-file=%t_esimd_0.ll
// RUN: -fsycl-is-device -emit-llvm %s -o - | FileCheck %s

// This test checks that FE allows globals with register_num attribute in ESIMD mode.
// This test checks that FE generates appropriate attributes for ESIMD private globals with register_num attribute.

__attribute__((opencl_private)) __attribute__((sycl_explicit_simd)) __attribute__((register_num(17))) int vc;
// CHECK: @vc = {{.+}} i32 0, align 4 #0
// CHECK: @vc = {{.+}} i32 0, align 4 #[[ATTR:[0-9]+]]

template <typename name, typename Func>
__attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
Expand All @@ -24,4 +17,4 @@ void init_vc(int x) {
// CHECK: store i32 %{{[0-9a-zA-Z_]+}}, i32* @vc
});
}
// CHECK: attributes #0 = {{.*"VCByteOffset"="17".*"VCVolatile"}}
// CHECK: attributes #[[ATTR]] = { "genx_byte_offset"="17" "genx_volatile" }