-
Notifications
You must be signed in to change notification settings - Fork 790
fix merge after readding syclkernel attr #20363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5569,7 +5569,9 @@ FunctionDecl *FunctionDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) { | |
|
||
bool FunctionDecl::isReferenceableKernel() const { | ||
return hasAttr<CUDAGlobalAttr>() || | ||
DeviceKernelAttr::isOpenCLSpelling(getAttr<DeviceKernelAttr>()) || hasAttr<DeviceKernelAttr>(); | ||
return hasAttr<CUDAGlobalAttr>() || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate lines: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is OK, I will remove it in the amend commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah my bad, github suggestion UI 👎 |
||
DeviceKernelAttr::isOpenCLSpelling(getAttr<DeviceKernelAttr>()) || | ||
hasAttr<SYCLKernelAttr>(); | ||
} | ||
|
||
BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5266,20 +5266,7 @@ static void handleCallConvAttr(Sema &S, Decl *D, const ParsedAttr &AL) { | |
static void handleDeviceKernelAttr(Sema &S, Decl *D, const ParsedAttr &AL) { | ||
const auto *FD = dyn_cast_or_null<FunctionDecl>(D); | ||
bool IsFunctionTemplate = FD && FD->getDescribedFunctionTemplate(); | ||
<<<<<<< HEAD | ||
if (S.getLangOpts().isSYCL()) { | ||
if (!IsFunctionTemplate) { | ||
S.Diag(AL.getLoc(), diag::warn_attribute_wrong_decl_type_str) | ||
<< AL << AL.isRegularKeywordAttribute() << "function templates"; | ||
} else { | ||
S.SYCL().handleKernelAttr(D, AL); | ||
} | ||
} else if (DeviceKernelAttr::isSYCLSpelling(AL)) { | ||
S.Diag(AL.getLoc(), diag::warn_attribute_ignored) << AL; | ||
} else if (S.getASTContext().getTargetInfo().getTriple().isNVPTX()) { | ||
======= | ||
if (S.getASTContext().getTargetInfo().getTriple().isNVPTX()) { | ||
>>>>>>> 1db148cc946eb95fefd5399766e379fc030eef78 | ||
handleGlobalAttr(S, D, AL); | ||
Comment on lines
5269
to
5270
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this is right. Prior to llvm/llvm-project#137882, processing of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For
so if the target doesn't match the the attr is never added, the check for the target agains the attr is in and this function can't be hit for so I think the cases There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I think I agree with that, but shouldn't there also be a check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. upstream Joseph was really against target-specific behavior, and even if seems confusing he would prefer for all the remaining spellings of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that he would like to have one attribute for kernels that are strongly tied to a particular target (though I don't necessarily agree with him). With this code as is though, wouldn't use of the OpenCL spellings end up going down the wrong branch when targeting NVPTX? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think you're right, but it doesn't seem to be causing any problems either upstream or here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I think that is reasonable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} else { | ||
// OpenCL C++ will throw a more specific error. | ||
|
@@ -7184,13 +7171,11 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL, | |
case ParsedAttr::AT_EnumExtensibility: | ||
handleEnumExtensibilityAttr(S, D, AL); | ||
break; | ||
<<<<<<< HEAD | ||
case ParsedAttr::AT_SYCLSimd: | ||
handleSimpleAttribute<SYCLSimdAttr>(S, D, AL); | ||
======= | ||
break; | ||
case ParsedAttr::AT_SYCLKernel: | ||
S.SYCL().handleKernelAttr(D, AL); | ||
>>>>>>> 1db148cc946eb95fefd5399766e379fc030eef78 | ||
break; | ||
case ParsedAttr::AT_SYCLExternal: | ||
handleSimpleAttribute<SYCLExternalAttr>(S, D, AL); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that checking for
SYCLKernelAttr
is correct here. We didn't check for it prior to llvm/llvm-project#137882 landing.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, upstream didnt, but we did in
syclos
before we pulled down that commit, see here https://github.com/intel/llvm/blob/nightly-2025-07-18/clang/include/clang/AST/GlobalDecl.h#L168There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, yes, added by commit 3b170e3 in May, the pulldown happened in commit fcd95a9, and that change was still present in the parent commit 6b2006a (from the previous pulldown). Isn't git archeology a joy.