-
Notifications
You must be signed in to change notification settings - Fork 220
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
Fix mangling issue #2471
base: main
Are you sure you want to change the base?
Fix mangling issue #2471
Conversation
Signed-off-by: Arvind Sudarsanam <[email protected]>
Signed-off-by: Arvind Sudarsanam <[email protected]>
Signed-off-by: Arvind Sudarsanam <[email protected]>
I was not able to come up with a test case that covered these changes. However, it seems like these hookups are required for robustness. Thanks |
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 was not able to come up with a test case that covered these changes. However, it seems like these hookups are required for robustness.
I'm a bit hesitant to accept this patch without any tests, because it affects quite a few places in the code. If an end-to-end test isn't easy to come up with, perhaps try to construct pass-specific tests using the pass plugin (see e.g. #2395).
@@ -3432,7 +3432,9 @@ bool SPIRVToLLVM::translate() { | |||
if (!transSourceExtension()) | |||
return false; | |||
transGeneratorMD(); | |||
if (!lowerBuiltins(BM, M)) | |||
SPIRVWord Ver = 0; | |||
SourceLanguage SrcLang = BM->getSourceLanguage(&Ver); |
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.
We should not be using a SPIR-V module's source language to affect the translation flow. The SPIR-V specification for OpSource
states:
This has no semantic impact and can safely be removed from a module.
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.
Hmm. But name mangling happens in a different way depending on what the source language is. If we have to unmangle the names. we need to know the source language. May be we can do something in the regularization pass?
Thanks
In 80dfd86, we turned on OCLToSPIRV and OCLTypeToSPIRV passes for OpenCL C++ and C++ for OpenCL source languages. In these passes, there are places where some names are mangled/unmangled. Existing code always passed IsCpp=false. With addition of C++ sources, we now need to store the Source language info and use it to figure out IsCpp.
Thanks