Skip to content
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

[llvmlite] Support opaque pointers. #908

Closed
wants to merge 4 commits into from

Conversation

folded
Copy link
Contributor

@folded folded commented Feb 17, 2023

Fix for issue #900

LLVM 14 introduces optional opaque pointers. If opaque pointers are enabled then there is no way to determine the pointee type. LLVM 16 makes this the default.

In llvmlite and numba this is used to determine ABI size and alignment of types by creating a global variable and then asking for its pointee type in order to get a TypeRef. For global variables specifically this can be shortcut via gv->getValueType(),
and doing so removes the current issues when opaque pointers are enabled.

This change has been tested with LLVM 11-14 and so also includes some other changes required to make llvmlite compile on those versions.

LLVM 14 introduces optional opaque pointers. If opaque pointers are
enabled then there is no way to determine the pointee type. LLVM 16
makes this the default.

In llvmlite and numba this is used to determine ABI size and alignment of
types by creating a global variable and then asking for its pointee type in
order to get a TypeRef. For global variables specifically this can be shortcut
via gv->getValueType(), and doing so removes the current issues when
opaque pointers are enabled.

This change has been tested with LLVM 11-14 and so also includes some
other changes required to make llvmlite compile on those versions.
@sklam sklam added this to the v0.41.0 milestone Feb 22, 2023
@esc esc removed this from the v0.41.0rc1 milestone Jul 13, 2023
@dlee992
Copy link
Contributor

dlee992 commented May 21, 2024

For a record: I guess this PR could be surpassed by #1042?

@gmarkall
Copy link
Member

For a record: I guess this PR could be surpassed by #1042?

Maybe technically, but we won't be able to merge #1042 because it contains the whole LLVM 17 transition in one go, and we need to adopt a more gradual strategy.

@dlee992
Copy link
Contributor

dlee992 commented May 21, 2024

Yeah, totally understandable.

@gmarkall
Copy link
Member

Opaque pointers were implemented in #1064 - closing.

Many thanks for this initial work / reference, @folded !

@gmarkall gmarkall closed this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants