-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Fix int-footer spec-const generation for deduced types. #3908
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
Conversation
Apparently my initial implementation documented the need to do this, but never did! We collect SpecConstants (the vector), and add ones we don't know if they are SpecConstants. However, the previous implementation forgot to skip the VarDecls that were later deduced to be a different type.
All of those make sense to me, done @AlexeySachkov |
clang/lib/Sema/SemaSYCL.cpp
Outdated
|
||
// Skip if this isn't a SpecIdType. This can happen if it was a deduced | ||
// type. | ||
if (!Util::isSyclSpecIdType(VD->getType().getCanonicalType())) |
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.
Do we always want isSyclSpecIdType()
to inspect the canonical type (e.g., sink the calls to getCanonicalType()
into the definition of the function rather than letting the caller decide which to pass)?
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 think we do, yes. All we care about is whether this is a spec-id type, we don't really care about whether it is wrapped in typedefs or not.
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.
Okay, then I'd change the implementation of isSyclSpecIdType()
to do the canonicalization rather than adding the calls here. I don't care if that's a follow-up or done as part of this patch though. WDYT?
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.
You're right here, we probably want the entire list of isNNNType functions in Util to canonicalize. I'll look into doing it in a follow-up
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.
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.
LGTM!
@bader @AlexeySachkov is the SYCL :: ESIMD/private_memory/pm_access_3.cpp test failure a 'known issue'? I'm not sure how this patch could cause it, and it seems pm_access_1.cpp is already failed before this patch. |
@erichkeane, yes, I disabled |
Apparently my initial implementation documented the need to do this, but
never did! We collect SpecConstants (the vector), and add ones we don't
know if they are SpecConstants. However, the previous implementation
forgot to skip the VarDecls that were later deduced to be a different
type.