Skip to content

Commit 39158c3

Browse files
author
Victor Lomuller
committed
Merge branch 'sycl' into work_group_static
2 parents 435c65a + 2f9db35 commit 39158c3

File tree

4 files changed

+49
-13
lines changed

4 files changed

+49
-13
lines changed

clang/lib/CodeGen/CGVTables.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,12 @@ void CodeGenVTables::addVTableComponent(ConstantArrayBuilder &builder,
803803
}
804804

805805
auto getSpecialVirtualFn = [&](StringRef name) -> llvm::Constant * {
806+
// There is no guarantee that special function for handling pure virtual
807+
// calls will be provided by a SYCL backend compiler and therefore we
808+
// simply emit nullptr here.
809+
if (CGM.getLangOpts().SYCLIsDevice)
810+
return llvm::ConstantPointerNull::get(CGM.GlobalsInt8PtrTy);
811+
806812
// FIXME(PR43094): When merging comdat groups, lld can select a local
807813
// symbol as the signature symbol even though it cannot be accessed
808814
// outside that symbol's TU. The relative vtables ABI would make
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// There is no guarantee that special symbol @__cxa_pure_virtual is supported
2+
// by SYCL backend compiler, so we need to make sure that we don't emit it
3+
// during SYCL device compilation.
4+
//
5+
// RUN: %clang_cc1 -triple spir64 -fsycl-is-device -emit-llvm %s -o - | FileCheck %s
6+
//
7+
// CHECK-NOT: @__cxa_pure_virtual
8+
9+
SYCL_EXTERNAL bool rand();
10+
11+
class Base {
12+
public:
13+
[[__sycl_detail__::add_ir_attributes_function("indirectly-callable", "a")]]
14+
virtual void display() {}
15+
16+
virtual void pure_host() = 0;
17+
18+
[[__sycl_detail__::add_ir_attributes_function("indirectly-callable", "a")]]
19+
virtual void pure_device() = 0;
20+
};
21+
22+
class Derived1 : public Base {
23+
public:
24+
[[__sycl_detail__::add_ir_attributes_function("indirectly-callable", "a")]]
25+
void display() override {}
26+
27+
void pure_host() override {}
28+
29+
[[__sycl_detail__::add_ir_attributes_function("indirectly-callable", "a")]]
30+
void pure_device() override {}
31+
};
32+
33+
SYCL_EXTERNAL void test() {
34+
Derived1 d1;
35+
Base *b = nullptr;
36+
if (rand())
37+
b = &d1;
38+
b->display();
39+
}
40+

devops/cts_exclude_filter_OCL_CPU

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
# https://github.com/intel/llvm/issues/13477
2-
math_builtin_api
3-
# https://github.com/intel/llvm/issues/13574
4-
hierarchical

xpti/include/xpti/xpti_trace_framework.hpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ typedef void *xpti_plugin_function_t;
5555
#endif
5656
#endif
5757

58-
/// Insert something when compiled with msvc
59-
/// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
60-
#ifdef _MSC_VER
61-
#define __XPTI_INSERT_IF_MSVC(x) x
62-
#else
63-
#define __XPTI_INSERT_IF_MSVC(x)
64-
#endif
65-
6658
namespace xpti {
6759
namespace utils {
6860
/// @class StringHelper
@@ -219,7 +211,9 @@ class PlatformHelper {
219211
#pragma GCC diagnostic push
220212
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
221213
#endif
222-
__XPTI_INSERT_IF_MSVC(__pragma(warning(suppress : 4996)))
214+
#ifdef _MSC_VER
215+
#pragma warning(suppress : 4996)
216+
#endif
223217
const char *val = std::getenv(var.c_str());
224218
#if defined(__GNUC__) || defined(__clang__)
225219
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)