Skip to content

Commit 665ea95

Browse files
committed
Apply code review comments.
1 parent 114b1dd commit 665ea95

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

clang/include/clang/Sema/ParsedAttr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,8 @@ class ParsedAttr final
659659
/// representation in LangAS, otherwise returns default address space.
660660
LangAS asSYCLLangAS() const {
661661
switch (getKind()) {
662+
// FIXME: there are uses of `opencl_constant` attribute in SYCL mode.
663+
// See https://github.com/intel/llvm/issues/3062 for more details.
662664
case ParsedAttr::AT_OpenCLConstantAddressSpace:
663665
return LangAS::opencl_constant;
664666
case ParsedAttr::AT_OpenCLGlobalAddressSpace:

clang/test/CodeGenSYCL/address-space-conversions.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
2+
3+
// Validates address space conversions for SYCL mode.
4+
// See clang/docs/SYCLSupport.rst#address-space-handling for allowed
5+
// conversions.
6+
27
void bar(int &Data) {}
38
// CHECK-DAG: define{{.*}} spir_func void @[[RAW_REF:[a-zA-Z0-9_]+]](i32 addrspace(4)* align 4 dereferenceable(4) %
49
void bar2(int &Data) {}

clang/test/CodeGenSYCL/address-space-deduction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
22

3+
// Validates SYCL deduction rules compliance.
4+
// See clang/docs/SYCLSupport.rst#address-space-handling for the details.
5+
36
// CHECK: @_ZZ4testvE3foo = internal addrspace(1) constant i32 66, align 4
47
// CHECK: @[[STR:[.a-zA-Z0-9_]+]] = private unnamed_addr addrspace(1) constant [14 x i8] c"Hello, world!\00", align 1
58

clang/test/SemaSYCL/address-space-conversions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// RUN: %clang_cc1 -fsycl-is-device -verify -fsyntax-only %s
22

3+
// Validates address space conversions for SYCL mode.
4+
// See clang/docs/SYCLSupport.rst#address-space-handling for allowed
5+
// conversions.
6+
37
void bar(int &Data) {}
48
void bar2(int &Data) {}
59
void bar(__attribute__((opencl_private)) int &Data) {}

0 commit comments

Comments
 (0)