-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIR][CodeGen] Define PackedFunc error code in MakePackedAPI (#15076)
* [TIR][CodeGen] Define PackedFunc error code in MakePackedAPI Previously, the return value of a PackedFunc was hard-coded as the string `"return 0;"` in `CodeGenCHost`, which could cause compilation errors for `PrimFunc` returning `DataType::Void()`. This PR removes this explicit return statement from `CodeGenCHost`, replacing it with `tir::ret(Integer(0))` in the `MakePackedAPI` and `MakeUnpackedAPI` transforms. This is related to #15073, which performs an analogous change for the function signature. * Handle builtin::ret() in CodeGenC * Place T.ret(0) inside asserts, rather than outside This causes fewer unit tests to break, and has more readable TVMScript. * Update unit tests to look inside SeqStmt * Handle T.ret(0) in CodeGenStackVM * Update MakeUnpackedAPI tests to expect T.ret
- Loading branch information
1 parent
6ef22f5
commit 0c09547
Showing
10 changed files
with
44 additions
and
21 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
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
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
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
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