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

[QoL][Relax] Return well-formed IR from relax::Function::CreateEmpty #16861

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the static method relax::Function::CreateEmpty returned a function with a nullptr as the body. While only intended for use in bookkeeping for TVMScript, allowing nullptr in this location can cause unexpected segfaults while debugging. For example, adding a print statement

This commit updates the relax::Function::CreateEmpty function to contain a placeholder body, consistent with the ret_struct_info argument provided.

Prior to this commit, the static method `relax::Function::CreateEmpty`
returned a function with a nullptr as the body.  While only intended for use in
bookkeeping for TVMScript, allowing nullptr in this location can cause
unexpected segfaults while debugging.  For example, adding a print
statement

This commit updates the `relax::Function::CreateEmpty` function to
contain a placeholder body, consistent with the `ret_struct_info`
argument provided.
@vinx13 vinx13 merged commit 94a44d7 into apache:main Apr 16, 2024
19 checks passed
@Lunderberg Lunderberg deleted the relax_qol_well_formed_ir_from_function_create_empty branch April 17, 2024 15:59
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.

2 participants