forked from apache/tvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLVM] Use Var annotation in LetStmt for pointer type (apache#14570)
* [LLVM] Use Var annotation in LetStmt for pointer type 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. * Resolve arg-type incompatibility with re-used context functions * Handle LLVM codegen for custom data types * Applied pointer-type fix to external callee as well * Use correct callee from GetContextPtr
- Loading branch information
1 parent
5566c3e
commit b6d7ce6
Showing
2 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters