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

Add an If variant to Rvsdg struct #306

Merged
merged 4 commits into from
Feb 3, 2024
Merged

Add an If variant to Rvsdg struct #306

merged 4 commits into from
Feb 3, 2024

Conversation

oflatt
Copy link
Member

@oflatt oflatt commented Jan 31, 2024

Currently Switch works on both booleans and integers.
This PR changes the Rvsdg struct to have an If that works on booleans and a Switch that works on integers.
This change required a significant amount of refactoring. For the translation to and from the milestone encoding, the current behavior is preserved by using Switch.

@oflatt oflatt requested a review from ezrosent January 31, 2024 20:20
@oflatt oflatt marked this pull request as draft January 31, 2024 21:14
@oflatt oflatt removed the request for review from ezrosent January 31, 2024 21:14
@oflatt oflatt marked this pull request as ready for review January 31, 2024 21:35
@oflatt oflatt requested a review from ezrosent January 31, 2024 21:35
Cond {
arg: Identifier,
val: CondVal,
bril_type: Type,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's document what different "types" here mean. I think this has caused some confusion in the past, and better signposting in the code could help.

src/rvsdg/from_cfg.rs Outdated Show resolved Hide resolved
src/rvsdg/from_cfg.rs Outdated Show resolved Hide resolved
src/rvsdg/mod.rs Outdated Show resolved Hide resolved
@oflatt oflatt merged commit 7e5bded into main Feb 3, 2024
4 checks passed
@oflatt oflatt deleted the oflatt-tree-if-conversion branch February 3, 2024 16:11
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