Skip to content

[Codegen][LLVM] Remove cast to i8* in builtin::address_of#14563

Merged
kparzysz-quic merged 2 commits intoapache:mainfrom
Lunderberg:codegen_llvm_remove_cast_in_address_of
Apr 11, 2023
Merged

[Codegen][LLVM] Remove cast to i8* in builtin::address_of#14563
kparzysz-quic merged 2 commits intoapache:mainfrom
Lunderberg:codegen_llvm_remove_cast_in_address_of

Conversation

@Lunderberg
Copy link
Copy Markdown
Contributor

This cast was initially added when CreateBufferPtr did not include the cast to the appropriate address space, and should no longer be necessary. Removing the cast will not harm LLVM configurations with opaque pointers (default in LLVM
15+
), and avoids type mismatches when using LLVM configurations that use typed pointers.

This cast was initially added when `CreateBufferPtr` did not include
the cast to the appropriate address space, and is no longer
necessary.  Removing the cast will not harm LLVM configurations with
opaque pointers ([default in LLVM
15+](https://github.com/llvm/llvm-project/blob/main/llvm/docs/OpaquePointers.rst)),
and avoids type mismatches when using LLVM configurations that use
typed pointers.
@tvm-bot
Copy link
Copy Markdown
Collaborator

tvm-bot commented Apr 10, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: codegen, llvm See #10317 for details

Generated by tvm-bot

1 similar comment
@tvm-bot
Copy link
Copy Markdown
Collaborator

tvm-bot commented Apr 10, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: codegen, llvm See #10317 for details

Generated by tvm-bot

@Lunderberg
Copy link
Copy Markdown
Contributor Author

This caused failures in llvm::verifyModule on a dev branch, in which the generated LLVM specified a function call to a function with a known signature. This doesn't usually result in verification failures for external function calls, because CodeGenLLVM::CreateCallExtern uses the call site itself to define the signature of each llvm::FunctionType.

For compatibility with earlier versions of LLVM.  Newer versions have
an overloaded prefetch intrinsic, and the pointer cast is unnecessary.
@kparzysz-quic kparzysz-quic merged commit 1c5442d into apache:main Apr 11, 2023
@Lunderberg Lunderberg deleted the codegen_llvm_remove_cast_in_address_of branch April 11, 2023 19:31
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.

3 participants