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

[LLVM] Use Var annotation in LetStmt for pointer type #14570

Merged
merged 8 commits into from
May 15, 2023

Conversation

Lunderberg
Copy link
Contributor

TIR has type-annotations on variables, but not on each PrimExpr. Because some versions of LLVM (before LLVM 15) default to using typed pointers, passing LLVM validation may require correct pointer types. This is typically encountered in unpacking of PackedFunc arguments, where the LLVM type of a data array must be cast from i8* to a pointer to the buffer type. These pointer-to-pointer casts are not expressible in TIR, because the tir::CastNode represents all pointers as DataType::Handle(), and so must be handled during codegen instead of earlier in the lowering flow.

TIR has type-annotations on variables, but not on each PrimExpr.
Because some versions of LLVM (before LLVM 15) default to using typed
pointers, passing LLVM validation may require correct pointer types.
This is typically encountered in unpacking of PackedFunc arguments,
where the LLVM type of a data array must be cast from `i8*` to a
pointer to the buffer type.  These pointer-to-pointer casts are not
expressible in TIR, because the `tir::CastNode` represents all
pointers as `DataType::Handle()`, and so must be handled during
codegen instead of earlier in the lowering flow.
@tvm-bot
Copy link
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: llvm See #10317 for details

Generated by tvm-bot

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