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

AOT Loop unrolling breaks Yk. #1414

Open
vext01 opened this issue Oct 7, 2024 · 2 comments
Open

AOT Loop unrolling breaks Yk. #1414

vext01 opened this issue Oct 7, 2024 · 2 comments
Assignees

Comments

@vext01
Copy link
Contributor

vext01 commented Oct 7, 2024

If you crank up the optimisation level on the promote_expr.c test it fails with:

ld.lld: error: yk_mt_control_point() must be called inside a loop.

And if you look at the AOT IR, you can see that the interpreter loop was unrolled and the calls to the control point have been duplicated (which may cause some related issues).

The safest thing to do in the short term would be to disable loop unrolling loops containing a call to the control point.

(We don't want to disable all loop unrolling though)

@vext01 vext01 self-assigned this Oct 7, 2024
@ltratt
Copy link
Contributor

ltratt commented Oct 7, 2024

The safest thing to do in the short term would be to disable loop unrolling loops

I think you mean "disable AOT loop unrolling in functions containing a control point"? [Obviously we still need to unroll such loops at tracing time!]

@vext01
Copy link
Contributor Author

vext01 commented Oct 7, 2024

disable AOT loop unrolling in functions containing a control point

From reading about it, it's not a function attribute, but rather metadata attached to an instruction in the loop itself. I assume you annotate the loop header, but I've not looked deeper yet.

If it pans out this way, this is actually good, as it's more flexible.

It means in a scenario like:

while(...) {
   control_point();
    ...
}

while(...) {
   some other random loop
}

The second loop could still be unrolled.

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

No branches or pull requests

2 participants