A question on pipelining capabilities
TheZoq2 opened this issue · comments
Hi!
I'm trying to compare bambu with my own research tool https://gitlab.com/cinnabar/cinnabar which is focused on pipelined functions with no dynamic loops. I am therefore interested in the capabilities of bambu with regards to pipelining of functions with complex control flow, in particular with phi nodes involved.
As an experiment, I have attempted to compile the following code
int test_fn(int x, int y) {
if (x > y) {
return x + y;
}
else if (x == 5) {
return y;
}
else {
return x-y;
}
}
with
bambu --top-fname=test_fn simple.cpp -p -O3 --print-dot --compiler=I386_CLANG12
which results in
error -> A pipeline should not contain phi operations (not multiple_in_edges)
Removing the middle else if
statement makes clang compile a select
instruction instead of phi
which makes it pass compilation.
Is there some option to enable more pipelining support, or are phi nodes in the code always going to cause issues? Are there plans to improve it if so?
Interestingly, replacing int
with double
seems to make the code compile, even though there are still phi nodes in the resulting .ll
file. However, for more complex code, I still run into the same issues.
Hi, the issue should have been fixed by the linked pull request which is now merged into the dev/panda branch.
Have you been able to test it out?
Please let us know if this is now working correctly.
Sorry for the very late reply, but yes. This seems to have fixed the issue
Thank you for reporting back, appreciate it!