Skip to content

Linkage type fix for global variables translation #1148

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

Merged
merged 2 commits into from
Aug 13, 2021
Merged

Linkage type fix for global variables translation #1148

merged 2 commits into from
Aug 13, 2021

Conversation

KornevNikita
Copy link
Contributor

This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".

This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
@KornevNikita
Copy link
Contributor Author

@AlexeySotkin @AlexeySachkov @mlychkov @MrSidims please take a look

@AlexeySotkin AlexeySotkin requested a review from svenvh August 9, 2021 17:36
Copy link
Member

@svenvh svenvh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but one nit about the test.

; CHECK-LLVM: @llvm.compiler.used = appending global
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (%union.int_double addrspace(1)** @._c0.ref to i8*)] #0

attributes #0 = { "VCGlobalVariable" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can translate it to SPIR-V without any extensions if we remove this attribute. We don't need it for the purpose of this test, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need it. I tried to remove this attribute and then translate, but @llvm.compiler.used also disappeared. But I found extensions, which are needed to translate this test insted of all.

@AlexeySotkin AlexeySotkin merged commit 22629a0 into KhronosGroup:master Aug 13, 2021
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Aug 30, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Aug 30, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Aug 30, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Aug 30, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Aug 30, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
MrSidims pushed a commit that referenced this pull request Sep 3, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
MrSidims pushed a commit that referenced this pull request Sep 3, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
MrSidims pushed a commit that referenced this pull request Sep 3, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Sep 3, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Sep 3, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
MrSidims pushed a commit that referenced this pull request Sep 3, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
MrSidims pushed a commit that referenced this pull request Sep 6, 2021
This is a workaround to fix translation of linkage type of "llvm.used" and
"llvm.compiler.used" global variables that should be "appending" instead of
"export".
@KornevNikita KornevNikita deleted the appending branch October 8, 2021 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants