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

Allow forcing loop unrolling on a per-loop basis #11938

Open
Speedphoenix opened this issue Jan 22, 2025 · 2 comments
Open

Allow forcing loop unrolling on a per-loop basis #11938

Speedphoenix opened this issue Jan 22, 2025 · 2 comments

Comments

@Speedphoenix
Copy link

There are cases where you want a loop to be unrolled regardless of cost (eg. to avoid allocation on an array in performance-sensitive functions.) Such cases may not warrant increasing -D loop_unroll_max_cost for the whole project.

Something like @:unroll or @:forceUnroll before a loop that guarantees unrolling or an error otherwise would help in these cases.

@kLabz
Copy link
Contributor

kLabz commented Jan 22, 2025

Maybe both @:unrollCost(X) for local override of -D loop_unroll_max_cost, and @:forceUnroll?

@Simn
Copy link
Member

Simn commented Jan 22, 2025

I was thinking inline for(...) could be a thing, but I haven't thought this through.

I'm fine with a metadata to override this though.

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

3 participants