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

[compiler] Add Switch to IR #13963

Merged
merged 8 commits into from
Nov 2, 2023
Merged

Conversation

ehigham
Copy link
Member

@ehigham ehigham commented Nov 1, 2023

We have no high-level IR analogue to CodeBuilderLike.switch. Such a node is useful for flattening the IR in deeply-nested If nodes, predicated on integer equality.
This partially addresses the stack-overflow error on the matrix_muluti_write_nothing benchmark, which currently has a stack-overflow error when computing the type of the CDA.

Copy link
Contributor

@danking danking left a comment

Choose a reason for hiding this comment

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

Needn't be in this PR, but it'd be nice if hl.switch from Python generated an ir.Switch when the discriminant is an int32!

@ehigham
Copy link
Member Author

ehigham commented Nov 1, 2023

Would you mind taking a look, Chris?

@ehigham
Copy link
Member Author

ehigham commented Nov 1, 2023

Needn't be in this PR, but it'd be nice if hl.switch from Python generated an ir.Switch when the discriminant is an int32!

Nice idea. I hadn't intended to expose this to python just yet. Using a table to index the cases would be much more powerful!

@danking danking merged commit 29c2966 into hail-is:main Nov 2, 2023
8 checks passed
@ehigham ehigham deleted the ehigham/add-switch-ir-node branch November 2, 2023 18:17
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.

3 participants