-
Notifications
You must be signed in to change notification settings - Fork 299
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
SCF IndexSwitch to nested If-Else #7670
base: main
Are you sure you want to change the base?
Conversation
#7669 supports nested also referencing calyxir/calyx#1177 and calyxir/calyx#1423 if they are relevant |
This needs test programs before we can merge it. Please add some tests and tag me when that's done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping this again.
Thanks for the reminder, I'll change and push again soon! |
I think I should move to directory Also tagging code owners for their opinions @mikeurbach @mortbopet , thanks! |
Yeah, I think that sounds like a good idea! |
Let's add tests before making @mortbopet or @mikeurbach review this PR... |
dfc0671
to
577722d
Compare
bumping this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one tiny suggestion.
This transform is meant for dialects that inherently does not have a switch control statement (like Calyx)
Another suggestion: make this a bit more descriptive (and declarative) so readers can more easily capture what's going on, e.g.:
Transforms scf.switch
to a series of scf.if
statements. This is necessary for dialects that don't support switch statements, e.g., Calyx. An example:
%0 = scf.index_switch %cond -> i32
case 0 { ... }
case 1 { ... }
...
=>
%c0 = arith.cmpi eq %0, 0
%c1 = arith.cmpi eq %0, 1
%0 = scf.if %c0 {
...
} else {
%1 = scf.if %c1 {
...
} else {
...
}
}
70e223c
to
fe89041
Compare
Thanks, refined the description and code based on your review! |
…ith invoking switchOp getCases many times by initialize a variable
0da30e4
to
dccf153
Compare
hi @rachitnigam , does this patch look good to you now? |
This transform is meant for dialects that inherently does not have a
switch
control statement (like Calyx)