Skip to content

Commit c845516

Browse files
authored
[SYCL][NFC] Remove unused WGSize instances from WorkGroupSizeAttribute (#2983)
Template parameter support for work_group_size attributes was added on #2906. Unsigned WGSize array which was used on function checkWorkGroupSizeValues() befor the support for the attributes dimension values to check correctness of mutual usage of different work_group_size attributes: reqd_work_group_size, max_work_group_size and max_global_work_dim, does not use anymore. This patch removes instances of WGSize array from the WorkGroupSizeAttribute. Signed-off-by: Soumi Manna <[email protected]>
1 parent 84d2eb5 commit c845516

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,8 +2975,7 @@ static void handleWeakImportAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
29752975
// In case the value of 'max_global_work_dim' attribute equals to 0 we shall
29762976
// ensure that if max_work_group_size and reqd_work_group_size attributes exist,
29772977
// they hold equal values (1, 1, 1).
2978-
static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &AL,
2979-
uint32_t WGSize[3]) {
2978+
static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &AL) {
29802979
bool Result = true;
29812980
auto checkZeroDim = [&S, &AL](auto &A, size_t X, size_t Y, size_t Z,
29822981
bool ReverseAttrs = false) -> bool {
@@ -3067,8 +3066,6 @@ static void handleWorkGroupSize(Sema &S, Decl *D, const ParsedAttr &AL) {
30673066
if (D->isInvalidDecl())
30683067
return;
30693068

3070-
uint32_t WGSize[3];
3071-
30723069
Expr *XDimExpr = AL.getArgAsExpr(0);
30733070

30743071
// If no attribute argument is specified, set to default value '1'
@@ -3121,7 +3118,7 @@ static void handleWorkGroupSize(Sema &S, Decl *D, const ParsedAttr &AL) {
31213118
}
31223119
}
31233120

3124-
if (!checkWorkGroupSizeValues(S, D, AL, WGSize))
3121+
if (!checkWorkGroupSizeValues(S, D, AL))
31253122
return;
31263123

31273124
S.addIntelSYCLTripleArgFunctionAttr<WorkGroupAttr>(D, AL, XDimExpr, YDimExpr,
@@ -3230,8 +3227,7 @@ static void handleMaxGlobalWorkDimAttr(Sema &S, Decl *D,
32303227

32313228
Expr *E = Attr.getArgAsExpr(0);
32323229

3233-
uint32_t WGSize[3] = {1, 1, 1};
3234-
if (!checkWorkGroupSizeValues(S, D, Attr, WGSize)) {
3230+
if (!checkWorkGroupSizeValues(S, D, Attr)) {
32353231
D->setInvalidDecl();
32363232
return;
32373233
}

0 commit comments

Comments
 (0)