Skip to content

Commit d299e93

Browse files
committed
Merge branch 'sycl' of https://github.com/intel/llvm into ianayl/2way-prefetch
2 parents af6ca57 + 42e63c1 commit d299e93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1318
-406
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10674,12 +10674,8 @@ static void getTripleBasedSPIRVTransOpts(Compilation &C,
1067410674
ArgStringList &TranslatorArgs) {
1067510675
bool IsCPU = Triple.isSPIR() &&
1067610676
Triple.getSubArch() == llvm::Triple::SPIRSubArch_x86_64;
10677-
// Enable NonSemanticShaderDebugInfo.200 for CPU AOT and for non-Windows
10678-
const bool IsWindowsMSVC =
10679-
Triple.isWindowsMSVCEnvironment() ||
10680-
C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment();
10681-
const bool EnableNonSemanticDebug =
10682-
IsCPU || (!IsWindowsMSVC && !C.getDriver().IsFPGAHWMode());
10677+
// Enable NonSemanticShaderDebugInfo.200 for non-FPGA targets.
10678+
const bool EnableNonSemanticDebug = !C.getDriver().IsFPGAHWMode();
1068310679
if (EnableNonSemanticDebug) {
1068410680
TranslatorArgs.push_back(
1068510681
"-spirv-debug-info-version=nonsemantic-shader-200");

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 125 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ class KernelObjVisitor {
15221522
void visitParam(ParmVarDecl *Param, QualType ParamTy,
15231523
HandlerTys &...Handlers) {
15241524
if (isSyclSpecialType(ParamTy, SemaSYCLRef))
1525-
KP_FOR_EACH(handleOtherType, Param, ParamTy);
1525+
KP_FOR_EACH(handleSyclSpecialType, Param, ParamTy);
15261526
else if (ParamTy->isStructureOrClassType()) {
15271527
if (KP_FOR_EACH(handleStructType, Param, ParamTy)) {
15281528
CXXRecordDecl *RD = ParamTy->getAsCXXRecordDecl();
@@ -2075,8 +2075,11 @@ class SyclKernelFieldChecker : public SyclKernelFieldHandler {
20752075
}
20762076

20772077
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
2078-
Diag.Report(PD->getLocation(), diag::err_bad_kernel_param_type) << ParamTy;
2079-
IsInvalid = true;
2078+
if (!SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory)) {
2079+
Diag.Report(PD->getLocation(), diag::err_bad_kernel_param_type)
2080+
<< ParamTy;
2081+
IsInvalid = true;
2082+
}
20802083
return isValid();
20812084
}
20822085

@@ -2228,8 +2231,8 @@ class SyclKernelUnionChecker : public SyclKernelFieldHandler {
22282231
}
22292232

22302233
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
2231-
// TODO
2232-
unsupportedFreeFunctionParamType();
2234+
if (!SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory))
2235+
unsupportedFreeFunctionParamType(); // TODO
22332236
return true;
22342237
}
22352238

@@ -3013,9 +3016,26 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
30133016
return handleSpecialType(FD, FieldTy);
30143017
}
30153018

3016-
bool handleSyclSpecialType(ParmVarDecl *, QualType) final {
3017-
// TODO
3018-
unsupportedFreeFunctionParamType();
3019+
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
3020+
if (SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory)) {
3021+
const auto *RecordDecl = ParamTy->getAsCXXRecordDecl();
3022+
assert(RecordDecl && "The type must be a RecordDecl");
3023+
CXXMethodDecl *InitMethod = getMethodByName(RecordDecl, InitMethodName);
3024+
assert(InitMethod && "The type must have the __init method");
3025+
// Don't do -1 here because we count on this to be the first parameter
3026+
// added (if any).
3027+
size_t ParamIndex = Params.size();
3028+
for (const ParmVarDecl *Param : InitMethod->parameters()) {
3029+
QualType ParamTy = Param->getType();
3030+
addParam(Param, ParamTy.getCanonicalType());
3031+
// Propagate add_ir_attributes_kernel_parameter attribute.
3032+
if (const auto *AddIRAttr =
3033+
Param->getAttr<SYCLAddIRAttributesKernelParameterAttr>())
3034+
Params.back()->addAttr(AddIRAttr->clone(SemaSYCLRef.getASTContext()));
3035+
}
3036+
LastParamIndex = ParamIndex;
3037+
} else // TODO
3038+
unsupportedFreeFunctionParamType();
30193039
return true;
30203040
}
30213041

@@ -3291,9 +3311,7 @@ class SyclKernelArgsSizeChecker : public SyclKernelFieldHandler {
32913311
}
32923312

32933313
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
3294-
// TODO
3295-
unsupportedFreeFunctionParamType();
3296-
return true;
3314+
return handleSpecialType(ParamTy);
32973315
}
32983316

32993317
bool handleSyclSpecialType(const CXXRecordDecl *, const CXXBaseSpecifier &BS,
@@ -4442,6 +4460,45 @@ class FreeFunctionKernelBodyCreator : public SyclKernelFieldHandler {
44424460
{});
44434461
}
44444462

4463+
MemberExpr *buildMemberExpr(Expr *Base, ValueDecl *Member) {
4464+
DeclAccessPair MemberDAP = DeclAccessPair::make(Member, AS_none);
4465+
MemberExpr *Result = SemaSYCLRef.SemaRef.BuildMemberExpr(
4466+
Base, /*IsArrow */ false, FreeFunctionSrcLoc, NestedNameSpecifierLoc(),
4467+
FreeFunctionSrcLoc, Member, MemberDAP,
4468+
/*HadMultipleCandidates*/ false,
4469+
DeclarationNameInfo(Member->getDeclName(), FreeFunctionSrcLoc),
4470+
Member->getType(), VK_LValue, OK_Ordinary);
4471+
return Result;
4472+
}
4473+
4474+
void createSpecialMethodCall(const CXXRecordDecl *RD, StringRef MethodName,
4475+
Expr *MemberBaseExpr,
4476+
SmallVectorImpl<Stmt *> &AddTo) {
4477+
CXXMethodDecl *Method = getMethodByName(RD, MethodName);
4478+
if (!Method)
4479+
return;
4480+
unsigned NumParams = Method->getNumParams();
4481+
llvm::SmallVector<Expr *, 4> ParamDREs(NumParams);
4482+
llvm::ArrayRef<ParmVarDecl *> KernelParameters =
4483+
DeclCreator.getParamVarDeclsForCurrentField();
4484+
for (size_t I = 0; I < NumParams; ++I) {
4485+
QualType ParamType = KernelParameters[I]->getOriginalType();
4486+
ParamDREs[I] = SemaSYCLRef.SemaRef.BuildDeclRefExpr(
4487+
KernelParameters[I], ParamType, VK_LValue, FreeFunctionSrcLoc);
4488+
}
4489+
MemberExpr *MethodME = buildMemberExpr(MemberBaseExpr, Method);
4490+
QualType ResultTy = Method->getReturnType();
4491+
ExprValueKind VK = Expr::getValueKindForType(ResultTy);
4492+
ResultTy = ResultTy.getNonLValueExprType(SemaSYCLRef.getASTContext());
4493+
llvm::SmallVector<Expr *, 4> ParamStmts;
4494+
const auto *Proto = cast<FunctionProtoType>(Method->getType());
4495+
SemaSYCLRef.SemaRef.GatherArgumentsForCall(FreeFunctionSrcLoc, Method,
4496+
Proto, 0, ParamDREs, ParamStmts);
4497+
AddTo.push_back(CXXMemberCallExpr::Create(
4498+
SemaSYCLRef.getASTContext(), MethodME, ParamStmts, ResultTy, VK,
4499+
FreeFunctionSrcLoc, FPOptionsOverride()));
4500+
}
4501+
44454502
public:
44464503
static constexpr const bool VisitInsideSimpleContainers = false;
44474504

@@ -4461,9 +4518,53 @@ class FreeFunctionKernelBodyCreator : public SyclKernelFieldHandler {
44614518
return true;
44624519
}
44634520

4464-
bool handleSyclSpecialType(ParmVarDecl *, QualType) final {
4465-
// TODO
4466-
unsupportedFreeFunctionParamType();
4521+
// Default inits the type, then calls the init-method in the body.
4522+
// A type may not have a public default constructor as per its spec so
4523+
// typically if this is the case the default constructor will be private and
4524+
// in such cases we must manually override the access specifier from private
4525+
// to public just for the duration of this default initialization.
4526+
// TODO: Revisit this approach once https://github.com/intel/llvm/issues/16061
4527+
// is closed.
4528+
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
4529+
if (SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory)) {
4530+
const auto *RecordDecl = ParamTy->getAsCXXRecordDecl();
4531+
AccessSpecifier DefaultConstructorAccess;
4532+
auto DefaultConstructor =
4533+
std::find_if(RecordDecl->ctor_begin(), RecordDecl->ctor_end(),
4534+
[](auto it) { return it->isDefaultConstructor(); });
4535+
DefaultConstructorAccess = DefaultConstructor->getAccess();
4536+
DefaultConstructor->setAccess(AS_public);
4537+
4538+
QualType Ty = PD->getOriginalType();
4539+
ASTContext &Ctx = SemaSYCLRef.SemaRef.getASTContext();
4540+
VarDecl *WorkGroupMemoryClone = VarDecl::Create(
4541+
Ctx, DeclCreator.getKernelDecl(), FreeFunctionSrcLoc,
4542+
FreeFunctionSrcLoc, PD->getIdentifier(), PD->getType(),
4543+
Ctx.getTrivialTypeSourceInfo(Ty), SC_None);
4544+
InitializedEntity VarEntity =
4545+
InitializedEntity::InitializeVariable(WorkGroupMemoryClone);
4546+
InitializationKind InitKind =
4547+
InitializationKind::CreateDefault(FreeFunctionSrcLoc);
4548+
InitializationSequence InitSeq(SemaSYCLRef.SemaRef, VarEntity, InitKind,
4549+
std::nullopt);
4550+
ExprResult Init = InitSeq.Perform(SemaSYCLRef.SemaRef, VarEntity,
4551+
InitKind, std::nullopt);
4552+
WorkGroupMemoryClone->setInit(
4553+
SemaSYCLRef.SemaRef.MaybeCreateExprWithCleanups(Init.get()));
4554+
WorkGroupMemoryClone->setInitStyle(VarDecl::CallInit);
4555+
DefaultConstructor->setAccess(DefaultConstructorAccess);
4556+
4557+
Stmt *DS = new (SemaSYCLRef.getASTContext())
4558+
DeclStmt(DeclGroupRef(WorkGroupMemoryClone), FreeFunctionSrcLoc,
4559+
FreeFunctionSrcLoc);
4560+
BodyStmts.push_back(DS);
4561+
Expr *MemberBaseExpr = SemaSYCLRef.SemaRef.BuildDeclRefExpr(
4562+
WorkGroupMemoryClone, Ty, VK_PRValue, FreeFunctionSrcLoc);
4563+
createSpecialMethodCall(RecordDecl, InitMethodName, MemberBaseExpr,
4564+
BodyStmts);
4565+
ArgExprs.push_back(MemberBaseExpr);
4566+
} else // TODO
4567+
unsupportedFreeFunctionParamType();
44674568
return true;
44684569
}
44694570

@@ -4748,9 +4849,11 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
47484849
return true;
47494850
}
47504851

4751-
bool handleSyclSpecialType(ParmVarDecl *, QualType) final {
4752-
// TODO
4753-
unsupportedFreeFunctionParamType();
4852+
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
4853+
if (SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory))
4854+
addParam(PD, ParamTy, SYCLIntegrationHeader::kind_work_group_memory);
4855+
else
4856+
unsupportedFreeFunctionParamType(); // TODO
47544857
return true;
47554858
}
47564859

@@ -6227,7 +6330,6 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
62276330
O << "#include <sycl/detail/defines_elementary.hpp>\n";
62286331
O << "#include <sycl/detail/kernel_desc.hpp>\n";
62296332
O << "#include <sycl/ext/oneapi/experimental/free_function_traits.hpp>\n";
6230-
62316333
O << "\n";
62326334

62336335
LangOptions LO;
@@ -6502,6 +6604,7 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
65026604

65036605
O << "\n";
65046606
O << "// Forward declarations of kernel and its argument types:\n";
6607+
Policy.SuppressDefaultTemplateArgs = false;
65056608
FwdDeclEmitter.Visit(K.SyclKernel->getType());
65066609
O << "\n";
65076610

@@ -6510,6 +6613,7 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
65106613
std::string ParmList;
65116614
bool FirstParam = true;
65126615
Policy.SuppressDefaultTemplateArgs = false;
6616+
Policy.PrintCanonicalTypes = true;
65136617
for (ParmVarDecl *Param : K.SyclKernel->parameters()) {
65146618
if (FirstParam)
65156619
FirstParam = false;
@@ -6518,6 +6622,7 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
65186622
ParmList += Param->getType().getCanonicalType().getAsString(Policy);
65196623
}
65206624
FunctionTemplateDecl *FTD = K.SyclKernel->getPrimaryTemplate();
6625+
Policy.PrintCanonicalTypes = false;
65216626
Policy.SuppressDefinition = true;
65226627
Policy.PolishForDeclaration = true;
65236628
Policy.FullyQualifiedName = true;
@@ -6577,6 +6682,8 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
65776682
}
65786683
O << ";\n";
65796684
O << "}\n";
6685+
Policy.SuppressDefaultTemplateArgs = true;
6686+
Policy.EnforceDefaultTemplateArgs = false;
65806687

65816688
// Generate is_kernel, is_single_task_kernel and nd_range_kernel functions.
65826689
O << "namespace sycl {\n";

clang/test/CodeGenSYCL/free_function_default_template_arguments.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@ templated3(Arg<T, notatuple, a, ns1::hasDefaultArg<>, int, int>, T end) {
6060

6161
template void templated3(Arg<int, notatuple, 3, ns1::hasDefaultArg<>, int, int>, int);
6262

63+
64+
namespace sycl {
65+
template <typename T> struct X {};
66+
template <> struct X<int> {};
67+
namespace detail {
68+
struct Y {};
69+
} // namespace detail
70+
template <> struct X<detail::Y> {};
71+
} // namespace sycl
72+
using namespace sycl;
73+
template <typename T, typename = X<detail::Y>> struct Arg1 { T val; };
74+
75+
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel",
76+
2)]] void
77+
foo(Arg1<int> arg) {
78+
arg.val = 42;
79+
}
80+
6381
// CHECK: Forward declarations of kernel and its argument types:
6482
// CHECK-NEXT: namespace ns {
6583
// CHECK-NEXT: struct notatuple;
@@ -98,3 +116,17 @@ template void templated3(Arg<int, notatuple, 3, ns1::hasDefaultArg<>, int, int>,
98116
// CHECK-NEXT: static constexpr auto __sycl_shim5() {
99117
// CHECK-NEXT: return (void (*)(struct ns::Arg<int, struct ns::notatuple, 3, class ns::ns1::hasDefaultArg<struct ns::notatuple>, int, int>, int))templated3<int, 3>;
100118
// CHECK-NEXT: }
119+
120+
// CHECK Forward declarations of kernel and its argument types:
121+
// CHECK: namespace sycl { namespace detail {
122+
// CHECK-NEXT: struct Y;
123+
// CHECK-NEXT: }}
124+
// CHECK-NEXT: namespace sycl {
125+
// CHECK-NEXT: template <typename T> struct X;
126+
// CHECK-NEXT: }
127+
// CHECK-NEXT: template <typename T, typename> struct Arg1;
128+
129+
// CHECK: void foo(Arg1<int, sycl::X<sycl::detail::Y> > arg);
130+
// CHECK-NEXT: static constexpr auto __sycl_shim6() {
131+
// CHECK-NEXT: return (void (*)(struct Arg1<int, struct sycl::X<struct sycl::detail::Y> >))foo;
132+
// CHECK-NEXT: }

clang/test/CodeGenSYCL/free_function_int_header.cpp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: FileCheck -input-file=%t.h %s
33
//
44
// This test checks integration header contents for free functions with scalar,
5-
// pointer and non-decomposed struct parameters.
5+
// pointer, non-decomposed struct parameters and work group memory parameters.
66

77
#include "mock_properties.hpp"
88
#include "sycl.hpp"
@@ -96,6 +96,12 @@ void ff_7(KArgWithPtrArray<ArrSize> KArg) {
9696

9797
template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
9898

99+
__attribute__((sycl_device))
100+
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 0)]]
101+
void ff_8(sycl::work_group_memory<int>) {
102+
}
103+
104+
99105
// CHECK: const char* const kernel_names[] = {
100106
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_2Piii
101107
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_2Piiii
@@ -105,6 +111,7 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
105111
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_410NoPointers8Pointers3Agg
106112
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_6I3Agg7DerivedEvT_T0_i
107113
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_7ILi3EEv16KArgWithPtrArrayIXT_EE
114+
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE
108115
// CHECK-NEXT: ""
109116
// CHECK-NEXT: };
110117

@@ -148,6 +155,9 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
148155
// CHECK: //--- _Z18__sycl_kernel_ff_7ILi3EEv16KArgWithPtrArrayIXT_EE
149156
// CHECK-NEXT: { kernel_param_kind_t::kind_std_layout, 48, 0 },
150157

158+
// CHECK: //--- _Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE
159+
// CHECK-NEXT: { kernel_param_kind_t::kind_work_group_memory, 8, 0 },
160+
151161
// CHECK: { kernel_param_kind_t::kind_invalid, -987654321, -987654321 },
152162
// CHECK-NEXT: };
153163

@@ -294,6 +304,26 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
294304
// CHECK-NEXT: };
295305
// CHECK-NEXT: }
296306

307+
// CHECK: Definition of _Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE as a free function kernel
308+
309+
// CHECK: Forward declarations of kernel and its argument types:
310+
// CHECK: template <typename DataT> class work_group_memory;
311+
312+
// CHECK: void ff_8(sycl::work_group_memory<int>);
313+
// CHECK-NEXT: static constexpr auto __sycl_shim9() {
314+
// CHECK-NEXT: return (void (*)(class sycl::work_group_memory<int>))ff_8;
315+
// CHECK-NEXT: }
316+
// CHECK-NEXT: namespace sycl {
317+
// CHECK-NEXT: template <>
318+
// CHECK-NEXT: struct ext::oneapi::experimental::is_kernel<__sycl_shim9()> {
319+
// CHECK-NEXT: static constexpr bool value = true;
320+
// CHECK-NEXT: };
321+
// CHECK-NEXT: template <>
322+
// CHECK-NEXT: struct ext::oneapi::experimental::is_single_task_kernel<__sycl_shim9()> {
323+
// CHECK-NEXT: static constexpr bool value = true;
324+
// CHECK-NEXT: };
325+
// CHECK-NEXT: }
326+
297327
// CHECK: #include <sycl/kernel_bundle.hpp>
298328

299329
// CHECK: Definition of kernel_id of _Z18__sycl_kernel_ff_2Piii
@@ -359,3 +389,11 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
359389
// CHECK-NEXT: return sycl::detail::get_kernel_id_impl(std::string_view{"_Z18__sycl_kernel_ff_7ILi3EEv16KArgWithPtrArrayIXT_EE"});
360390
// CHECK-NEXT: }
361391
// CHECK-NEXT: }
392+
393+
// CHECK: Definition of kernel_id of _Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE
394+
// CHECK-NEXT: namespace sycl {
395+
// CHECK-NEXT: template <>
396+
// CHECK-NEXT: kernel_id ext::oneapi::experimental::get_kernel_id<__sycl_shim9()>() {
397+
// CHECK-NEXT: return sycl::detail::get_kernel_id_impl(std::string_view{"_Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE"});
398+
// CHECK-NEXT: }
399+
// CHECK-NEXT: }

clang/test/CodeGenSYCL/free_function_kernel_params.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_cc1 -internal-isystem %S/Inputs -fsycl-is-device -triple spir64 \
22
// RUN: -emit-llvm %s -o - | FileCheck %s
33
// This test checks parameter IR generation for free functions with parameters
4-
// of non-decomposed struct type.
4+
// of non-decomposed struct type and work group memory type.
55

66
#include "sycl.hpp"
77

@@ -56,3 +56,18 @@ template void ff_6(KArgWithPtrArray<TestArrSize> KArg);
5656
// CHECK: %struct.KArgWithPtrArray = type { [3 x ptr addrspace(4)], [3 x i32], [3 x i32] }
5757
// CHECK: define dso_local spir_kernel void @{{.*}}__sycl_kernel{{.*}}(ptr noundef byval(%struct.NoPointers) align 4 %__arg_S1, ptr noundef byval(%struct.__generated_Pointers) align 8 %__arg_S2, ptr noundef byval(%struct.__generated_Agg) align 8 %__arg_S3)
5858
// CHECK: define dso_local spir_kernel void @{{.*}}__sycl_kernel_ff_6{{.*}}(ptr noundef byval(%struct.__generated_KArgWithPtrArray) align 8 %__arg_KArg)
59+
60+
__attribute__((sycl_device))
61+
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 0)]]
62+
void ff_7(sycl::work_group_memory<int> mem) {
63+
}
64+
65+
// CHECK: define dso_local spir_kernel void @{{.*}}__sycl_kernel_ff_7{{.*}}(ptr addrspace(3) noundef align 4 %__arg_Ptr)
66+
// CHECK: %__arg_Ptr.addr = alloca ptr addrspace(3), align 8
67+
// CHECK-NEXT: %mem = alloca %"class.sycl::_V1::work_group_memory", align 8
68+
// CHECK: %__arg_Ptr.addr.ascast = addrspacecast ptr %__arg_Ptr.addr to ptr addrspace(4)
69+
// CHECK-NEXT: %mem.ascast = addrspacecast ptr %mem to ptr addrspace(4)
70+
// CHECK: store ptr addrspace(3) %__arg_Ptr, ptr addrspace(4) %__arg_Ptr.addr.ascast, align 8
71+
// CHECK-NEXT: [[REGISTER:%[a-zA-Z0-9_]+]] = load ptr addrspace(3), ptr addrspace(4) %__arg_Ptr.addr.ascast, align 8
72+
// CHECK-NEXT: call spir_func void @{{.*}}work_group_memory{{.*}}__init{{.*}}(ptr addrspace(4) noundef align 8 dereferenceable_or_null(8) %mem.ascast, ptr addrspace(3) noundef [[REGISTER]])
73+

0 commit comments

Comments
 (0)