Skip to content

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the relax::Tuple constructor left the struct_info_ field undefined. This is inconsistent with other Relax leaf nodes, such as relax::PrimValue, relax::Constant, and relax::ExternFunc, which initialize their struct info on construction.

This commit updates the relax::Tuple constructor to define struct_info_ as TupleStructInfo, if all fields have a known struct info. If any field does not have a known struct info, the current behavior is kept, where struct_info_ is constructed as NullOpt, and is later populated by the relax::BlockBuilder.

Prior to this commit, the `relax::Tuple` constructor left the
`struct_info_` field undefined.  This is inconsistent with other Relax
leaf nodes, such as `relax::PrimValue`, `relax::Constant`, and
`relax::ExternFunc`, which initialize their struct info on
construction.

This commit updates the `relax::Tuple` constructor to define
`struct_info_` as `TupleStructInfo`, if all fields have a known struct
info.  If any field does not have a known struct info, the current
behavior is kept, where `struct_info_` is constructed as `NullOpt`,
and is later populated by the `relax::BlockBuilder`.
@vinx13 vinx13 merged commit 460f6f1 into apache:main Apr 16, 2024
@Lunderberg Lunderberg deleted the relax_qol_infer_tuple_struct_info_on_construction 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