Skip to content
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
18 changes: 0 additions & 18 deletions clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -1998,15 +1998,6 @@ def SYCLIntelMaxWorkGroupsPerMultiprocessor : InheritableAttr {
let Documentation = [SYCLIntelMaxWorkGroupsPerMultiprocessorDocs];
}

def SYCLIntelMaxGlobalWorkDim : InheritableAttr {
let Spellings = [CXX11<"intel", "max_global_work_dim">];
let Args = [ExprArgument<"Value">];
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [SYCLIntelMaxGlobalWorkDimAttrDocs];
let SupportsNonconformingLambdaSyntax = 1;
}

def SYCLDeviceGlobal: InheritableAttr {
let Spellings = [CXX11<"__sycl_detail__", "device_global">];
let Subjects = SubjectList<[CXXRecord], ErrorDiag>;
Expand All @@ -2025,15 +2016,6 @@ def SYCLGlobalVariableAllowed : InheritableAttr {
let SimpleHandler = 1;
}

def SYCLIntelNoGlobalWorkOffset : InheritableAttr {
let Spellings = [CXX11<"intel", "no_global_work_offset">];
let Args = [ExprArgument<"Value", /*optional*/1>];
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [SYCLIntelNoGlobalWorkOffsetAttrDocs];
let SupportsNonconformingLambdaSyntax = 1;
}

class SYCLAddIRAttrMemberCodeHolder<code Code> {
code MemberCode = Code;
}
Expand Down
86 changes: 0 additions & 86 deletions clang/include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -3464,92 +3464,6 @@ SM_90 or higher.
}];
}

def SYCLIntelMaxGlobalWorkDimAttrDocs : Documentation {
let Category = DocCatFunction;
let Heading = "intel::max_global_work_dim";
let Content = [{
Applies to a device function/lambda function or function call operator (of a
function object). Indicates the largest valid global work dimension that will be
accepted when running the kernel on a device. Valid values are integers in a
range of [0, 3].

In SYCL 1.2.1 mode, the ``intel::max_global_work_dim`` attribute is propagated
from the function it is applied to onto the kernel which calls the function.
In SYCL 2020 mode, the attribute is not propagated to the kernel.

.. code-block:: c++

[[intel::max_global_work_dim(1)]] void foo() {}

template<int N>
[[intel::max_global_work_dim(N)]] void bar() {}

class Foo {
public:
[[intel::max_global_work_dim(1)]] void operator()() const {}
};

template <int N>
class Functor {
public:
[[intel::max_global_work_dim(N)]] void operator()() const {}
};

A kernel with ``intel::max_global_work_dim(0)`` must be invoked with a
'single_task' and if ``intel::max_work_group_size`` or
``cl::reqd_work_group_size`` are applied to the kernel as well - they shall
have arguments of (1, 1, 1).

.. code-block:: c++

struct TRIFuncObjGood {
[[intel::max_global_work_dim(0)]]
[[intel::max_work_group_size(1, 1, 1)]]
[[cl::reqd_work_group_size(1, 1, 1)]]
void operator()() const {}
};

}];
}

def SYCLIntelNoGlobalWorkOffsetAttrDocs : Documentation {
let Category = DocCatFunction;
let Heading = "intel::no_global_work_offset";
let Content = [{
Applies to a device function/lambda function or function call operator (of a
function object). If 1, compiler doesn't use the global work offset values for
the device function. Valid values are 0 and 1. If used without argument, value
of 1 is set implicitly.

In SYCL 1.2.1 mode, the ``intel::no_global_work_offset`` attribute is
propagated from the function it is applied to onto the kernel which calls the
function. In SYCL 2020 mode, the attribute is not propagated to the kernel.

.. code-block:: c++

[[intel::no_global_work_offset]]
// identical to [[intel::no_global_work_offset(1)]]
void quux() {}

[[intel::no_global_work_offset(0)]] void foo() {}

class Foo {
public:
[[intel::no_global_work_offset(1)]] void operator()() const {}
};

template <int N>
class Functor {
public:
[[intel::no_global_work_offset(N)]] void operator()() const {}
};

template <int N>
[[intel::no_global_work_offset(N)]] void func() {}

}];
}

def SYCLDeviceGlobalAttrDocs : Documentation {
let Category = DocCatType;
let Heading = "__sycl_detail__::device_global";
Expand Down
12 changes: 0 additions & 12 deletions clang/include/clang/Sema/SemaSYCL.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,6 @@ class SemaSYCL : public SemaBase {
void handleIntelReqdSubGroupSizeAttr(Decl *D, const ParsedAttr &AL);
void handleIntelNamedSubGroupSizeAttr(Decl *D, const ParsedAttr &AL);
void handleSYCLIntelNumSimdWorkItemsAttr(Decl *D, const ParsedAttr &AL);
void handleSYCLIntelMaxGlobalWorkDimAttr(Decl *D, const ParsedAttr &AL);
void handleSYCLIntelNoGlobalWorkOffsetAttr(Decl *D, const ParsedAttr &AL);
void handleIntelSimpleDualPortAttr(Decl *D, const ParsedAttr &AL);
void handleSYCLAddIRAttributesFunctionAttr(Decl *D, const ParsedAttr &AL);
void handleSYCLAddIRAttributesKernelParameterAttr(Decl *D,
Expand All @@ -512,9 +510,6 @@ class SemaSYCL : public SemaBase {
SYCLIntelNumSimdWorkItemsAttr *
mergeSYCLIntelNumSimdWorkItemsAttr(Decl *D,
const SYCLIntelNumSimdWorkItemsAttr &A);
SYCLIntelMaxGlobalWorkDimAttr *
mergeSYCLIntelMaxGlobalWorkDimAttr(Decl *D,
const SYCLIntelMaxGlobalWorkDimAttr &A);
SYCLIntelMinWorkGroupsPerComputeUnitAttr *
mergeSYCLIntelMinWorkGroupsPerComputeUnitAttr(
Decl *D, const SYCLIntelMinWorkGroupsPerComputeUnitAttr &A);
Expand All @@ -524,8 +519,6 @@ class SemaSYCL : public SemaBase {
SYCLIntelESimdVectorizeAttr *
mergeSYCLIntelESimdVectorizeAttr(Decl *D,
const SYCLIntelESimdVectorizeAttr &A);
SYCLIntelNoGlobalWorkOffsetAttr *mergeSYCLIntelNoGlobalWorkOffsetAttr(
Decl *D, const SYCLIntelNoGlobalWorkOffsetAttr &A);
SYCLAddIRAttributesFunctionAttr *mergeSYCLAddIRAttributesFunctionAttr(
Decl *D, const SYCLAddIRAttributesFunctionAttr &A);
SYCLAddIRAttributesKernelParameterAttr *
Expand Down Expand Up @@ -605,11 +598,6 @@ class SemaSYCL : public SemaBase {
Expr **Exprs, unsigned Size);
void addSYCLIntelNumSimdWorkItemsAttr(Decl *D, const AttributeCommonInfo &CI,
Expr *E);
void addSYCLIntelNoGlobalWorkOffsetAttr(Decl *D,
const AttributeCommonInfo &CI,
Expr *E);
void addSYCLIntelMaxGlobalWorkDimAttr(Decl *D, const AttributeCommonInfo &CI,
Expr *E);
void addSYCLIntelMinWorkGroupsPerComputeUnitAttr(
Decl *D, const AttributeCommonInfo &CI, Expr *E);
void addSYCLIntelMaxWorkGroupsPerMultiprocessorAttr(
Expand Down
16 changes: 0 additions & 16 deletions clang/lib/CodeGen/CodeGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,15 +832,6 @@ void CodeGenFunction::EmitKernelMetadata(const FunctionDecl *FD,
llvm::MDNode::get(Context, AttrMDArgs));
}

if (const auto *A = FD->getAttr<SYCLIntelMaxGlobalWorkDimAttr>()) {
const auto *CE = cast<ConstantExpr>(A->getValue());
std::optional<llvm::APSInt> ArgVal = CE->getResultAsAPSInt();
llvm::Metadata *AttrMDArgs[] = {llvm::ConstantAsMetadata::get(
Builder.getInt32(ArgVal->getSExtValue()))};
Fn->setMetadata("max_global_work_dim",
llvm::MDNode::get(Context, AttrMDArgs));
}

auto attrAsMDArg = [&](Expr *E) {
const auto *CE = cast<ConstantExpr>(E);
std::optional<llvm::APSInt> ArgVal = CE->getResultAsAPSInt();
Expand Down Expand Up @@ -872,13 +863,6 @@ void CodeGenFunction::EmitKernelMetadata(const FunctionDecl *FD,
llvm::MDNode::get(Context, AttrMDArgs));
}
}

if (const auto *A = FD->getAttr<SYCLIntelNoGlobalWorkOffsetAttr>()) {
const auto *CE = cast<ConstantExpr>(A->getValue());
std::optional<llvm::APSInt> ArgVal = CE->getResultAsAPSInt();
if (ArgVal->getBoolValue())
Fn->setMetadata("no_global_work_offset", llvm::MDNode::get(Context, {}));
}
}

/// Determine whether the function F ends with a return stmt.
Expand Down
4 changes: 0 additions & 4 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2987,8 +2987,6 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
NewAttr = S.SYCL().mergeSYCLIntelNumSimdWorkItemsAttr(D, *A);
else if (const auto *A = dyn_cast<SYCLIntelESimdVectorizeAttr>(Attr))
NewAttr = S.SYCL().mergeSYCLIntelESimdVectorizeAttr(D, *A);
else if (const auto *A = dyn_cast<SYCLIntelNoGlobalWorkOffsetAttr>(Attr))
NewAttr = S.SYCL().mergeSYCLIntelNoGlobalWorkOffsetAttr(D, *A);
else if (const auto *A = dyn_cast<SYCLWorkGroupSizeHintAttr>(Attr))
NewAttr = S.SYCL().mergeSYCLWorkGroupSizeHintAttr(D, *A);
else if (const auto *A =
Expand All @@ -2997,8 +2995,6 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
else if (const auto *A =
dyn_cast<SYCLIntelMaxWorkGroupsPerMultiprocessorAttr>(Attr))
NewAttr = S.SYCL().mergeSYCLIntelMaxWorkGroupsPerMultiprocessorAttr(D, *A);
else if (const auto *A = dyn_cast<SYCLIntelMaxGlobalWorkDimAttr>(Attr))
NewAttr = S.SYCL().mergeSYCLIntelMaxGlobalWorkDimAttr(D, *A);
else if (const auto *BTFA = dyn_cast<BTFDeclTagAttr>(Attr))
NewAttr = S.mergeBTFDeclTagAttr(D, *BTFA);
else if (const auto *A = dyn_cast<SYCLDeviceHasAttr>(Attr))
Expand Down
9 changes: 0 additions & 9 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7926,12 +7926,6 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
case ParsedAttr::AT_SYCLIntelNumSimdWorkItems:
S.SYCL().handleSYCLIntelNumSimdWorkItemsAttr(D, AL);
break;
case ParsedAttr::AT_SYCLIntelMaxGlobalWorkDim:
S.SYCL().handleSYCLIntelMaxGlobalWorkDimAttr(D, AL);
break;
case ParsedAttr::AT_SYCLIntelNoGlobalWorkOffset:
S.SYCL().handleSYCLIntelNoGlobalWorkOffsetAttr(D, AL);
break;
case ParsedAttr::AT_VecTypeHint:
handleVecTypeHint(S, D, AL);
break;
Expand Down Expand Up @@ -8495,9 +8489,6 @@ void Sema::ProcessDeclAttributeList(
D->getAttr<SYCLIntelMaxWorkGroupsPerMultiprocessorAttr>()) {
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
D->setInvalidDecl();
} else if (const auto *A = D->getAttr<SYCLIntelNoGlobalWorkOffsetAttr>()) {
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
D->setInvalidDecl();
} else if (const auto *A = D->getAttr<VecTypeHintAttr>()) {
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
D->setInvalidDecl();
Expand Down
7 changes: 2 additions & 5 deletions clang/lib/Sema/SemaSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,9 @@ static void collectSYCLAttributes(FunctionDecl *FD,
return isa<IntelReqdSubGroupSizeAttr, IntelNamedSubGroupSizeAttr,
SYCLReqdWorkGroupSizeAttr, SYCLWorkGroupSizeHintAttr,
SYCLIntelKernelArgsRestrictAttr, SYCLIntelNumSimdWorkItemsAttr,
SYCLIntelMaxWorkGroupSizeAttr, SYCLIntelMaxGlobalWorkDimAttr,
SYCLIntelMaxWorkGroupSizeAttr,
SYCLIntelMinWorkGroupsPerComputeUnitAttr,
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr,
SYCLIntelNoGlobalWorkOffsetAttr, SYCLSimdAttr,
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr, SYCLSimdAttr,
SYCLDeviceHasAttr, SYCLAddIRAttributesFunctionAttr>(A);
});
}
Expand Down Expand Up @@ -5794,10 +5793,8 @@ static void PropagateAndDiagnoseDeviceAttr(SemaSYCL &S, Attr *A,
LLVM_FALLTHROUGH;
case attr::Kind::SYCLIntelKernelArgsRestrict:
case attr::Kind::SYCLIntelNumSimdWorkItems:
case attr::Kind::SYCLIntelMaxGlobalWorkDim:
case attr::Kind::SYCLIntelMinWorkGroupsPerComputeUnit:
case attr::Kind::SYCLIntelMaxWorkGroupsPerMultiprocessor:
case attr::Kind::SYCLIntelNoGlobalWorkOffset:
case attr::Kind::SYCLDeviceHas:
case attr::Kind::SYCLAddIRAttributesFunction:
SYCLKernel->addAttr(A);
Expand Down
Loading
Loading