Skip to content

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

Merged
Lunderberg merged 8 commits intoapache:mainfrom
Lunderberg:llvm_pointer_type_from_var
May 15, 2023
Merged

[LLVM] Use Var annotation in LetStmt for pointer type#14570
Lunderberg merged 8 commits intoapache:mainfrom
Lunderberg:llvm_pointer_type_from_var

Conversation

@Lunderberg
Copy link
Copy Markdown
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
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: 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