-
Notifications
You must be signed in to change notification settings - Fork 23
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
partialexecuter: increment and check basicblock visit count after terminals #205
Conversation
Although the crash in leaningtech/cheerp-meta#133 doesn't seem to happen anymore, it did cause a hang. Closes: leaningtech/cheerp-meta#133 |
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.
I don't really have experience with PartialExecuter. I would like @alexp-sssup to have a look.
else | ||
{ | ||
skip = true; | ||
if (data.getVisitCounter(next) < MAX_NUMBER_OF_VISITS_PER_BB) |
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.
This looks reasonable. Currently the check is only done when starting the visit from a new block, but internal visits are not accounted for. Two things
- Move the new check inside the existing if to better preserve the code history
- Please validate that prints is still correctly optimized away in easy cases, we might need to bump the max number of visits since we are now counting much more often
@alexp-sssup I did a check with the following code and it generated the exact same before and after the changes: #include <stdio.h>
int main() {
printf("%3i, %x, %f, %e, %f, %g, %0f, %10f, %.10f, %-f\n", 42, 21, 3.41, 2.72, 0.5, -6.12, 6564.34534, 0.001, 3.0, -10.433);
} |
That test case is not a good one since it's keeping in lots of logic by using multiple type of % format options. Try a simpler test case with just %i or %x |
I also tried using this one, which also generated the same code before and after: #include <stdio.h>
int main() {
printf("%i %i %i %i %i\n", 42, 21, 0, 1, 543234);
printf("%x %x %x %x %x\n", 42, 21, 0, 1, 543234);
} |
I checked, and before and after it does not go through this branch that handles terminals though |
Merged |
That's ok, it means this code path is not as critical as I though |
No description provided.