-
Notifications
You must be signed in to change notification settings - Fork 302
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
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! |
0da30e4
to
dccf153
Compare
hi @rachitnigam , does this patch look good to you now? |
…ith invoking switchOp getCases many times by initialize a variable
dccf153
to
473d329
Compare
This patch failed nightly valgrind regressions: https://github.com/llvm/circt/actions/runs/12030131054/job/33536896034#step:6:5229
|
This reverts commit d379a35. This patch failed valgrind nightly regressions. I'm blamelessly reverting this to keep nightly clean.
This reverts commit d379a35. This patch failed valgrind nightly regressions. I'm blamelessly reverting this to keep nightly clean.
Blamelessly reverted in b987492 to keep nightly clean. |
Thanks for catching it @seldridge . Let me try to fix it. Do you know how to run FAILED: tools/circt/test/CMakeFiles/check-circt /__w/circt/circt/build/tools/circt/test/CMakeFiles/check-circt
cd /__w/circt/circt/build/tools/circt/test && /usr/bin/python3.9 /__w/circt/circt/build/./bin/llvm-lit -v --show-unsupported --vg /__w/circt/circt/build/tools/circt/test but I can't find all those directories locally. For example, there's no |
It may just work if you take that test and run in through
That then runs every test under |
I see, thank you! |
This transform is meant for dialects that inherently does not have a
switch
control statement (like Calyx)