Skip to content

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

Merged
vinx13 merged 1 commit intoapache:mainfrom
Lunderberg:relax_qol_well_formed_ir_from_function_create_empty
Apr 16, 2024
Merged

[QoL][Relax] Return well-formed IR from relax::Function::CreateEmpty#16861
vinx13 merged 1 commit intoapache:mainfrom
Lunderberg:relax_qol_well_formed_ir_from_function_create_empty

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
@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