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

clava.code.WhileToForStmt Transformation #103

Open
joaobispo opened this issue Sep 14, 2022 · 0 comments
Open

clava.code.WhileToForStmt Transformation #103

joaobispo opened this issue Sep 14, 2022 · 0 comments

Comments

@joaobispo
Copy link
Member

joaobispo commented Sep 14, 2022

The transformation clava.opt.Inlining is applied after the C/C++ code is normalized to a C/C++ subset designed for code analysis and transformations (clava.opt.NormalizeToSubset).

However, the current C/C++ subset removes for loops, transforming them into while loops. For certain cases, it is preferable to have for loops (e.g. parallelization using OpenMP).

One solution could be disabling the for loop transformation. However, this makes the subset transformation and subsequent use more complex, since now it has to deal with both for and while loops.

An alternative is to create a clava.code.WhileToForStmt transformation pass that re-introduces the for loops at will, from the while loops, which could be similar to the transformations ForToWhileStmt (code) and DoToWhileStmt (code)

@joaobispo joaobispo changed the title clava.code.ForToWhileStmt Transformation clava.code.WhileToForStmt Transformation Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant