Skip to content

[ChildTyper] Handle missing type immediates - #9302

Open
tlively wants to merge 1 commit into
mainfrom
type-ssa-child-typer
Open

tlively wants to merge 1 commit into
mainfrom
type-ssa-child-typer

Conversation

@tlively

@tlively tlively commented Oct 23, 2026

Copy link
Copy Markdown
Member

Previously ChildTyper would crash when run on an expression that did not have type immediate information, e.g. a StructGet with a null child. This is fine when IRBuilder uses ChildTyper because it has access to the original type immediates. The other user of ChildTyper, TypeSSA, worked around the problem by checking whether the type immediate information was available before calling ChildTyper.

As various type generalization passes become more important, ChildTyper will need to run on arbitrary IR to help do backward type analyses. Fix ChildTyper so it calls noteUnknown() rather than crashing when the information it needs is absent. Remove the check from TypeSSA so we can get full test coverage of the new changes via TypeSSA lit tests.

Previously ChildTyper would crash when run on an expression that did not have type immediate information, e.g. a StructGet with a null child. This is fine when IRBuilder uses ChildTyper because it has access to the original type immediates. The other user of ChildTyper, TypeSSA, worked around the problem by checking whether the type immediate information was available before calling ChildTyper.

As various type generalization passes become more important, ChildTyper will need to run on arbitrary IR to help do backward type analyses. Fix ChildTyper so it calls noteUnknown() rather than crashing when the information it needs is absent. Remove the check from TypeSSA so we can get full test coverage of the new changes via TypeSSA lit tests.
@tlively
tlively requested a review from a team as a code owner October 23, 2026 21:55
@tlively
tlively requested review from kripken and removed request for a team October 23, 2026 21:55

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the ChildTyper to use more specific type checks (such as isStruct(), isArray(), and isContinuation()) instead of generic isRef() checks. Additionally, it updates the TypeSSA pass analyzer to properly visit sub-expressions for RefCast and BrOn instructions, refines the optimization-skipping logic, and adds comprehensive test coverage for these scenarios. I have no feedback to provide as there are no review comments to evaluate.

This branch has not been deployed

No deployments
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.

1 participant