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

tapir compiler does not terminate #83

Closed
wheatman opened this issue Jan 31, 2019 · 5 comments
Closed

tapir compiler does not terminate #83

wheatman opened this issue Jan 31, 2019 · 5 comments

Comments

@wheatman
Copy link

After manually in-lining a single function inside of a cilk_for loop the compiler no longer terminates.
The code can be found here https://github.com/wheatman/extended-csr/tree/compilier-spin
If you change OFM.cpp: 1615 - 1660 to add_edge_update_fast
Which is the same thing just in its own function with a no inline attribute then the compiler will terminate with correct results.

@wsmoses
Copy link
Owner

wsmoses commented Jan 31, 2019

Note this is not an issue on master, but rather with WIP-taskinfo @neboat assigning to you.

@neboat
Copy link
Collaborator

neboat commented Jan 31, 2019

I think I've found the problem. On line 1638 of OFM.cpp, the code is performing a return in the body of a cilk_for loop. Such code is illegal — you can't return from the body of a cilk_for loop — but the front end doesn't currently report that this statement as illegal.

I think we've seen this error arise in other contexts, and it's definitely something we should fix.

@wheatman
Copy link
Author

That does seem to be it, when I change the code to remove that,
By simply moving the rest of the function into an else and getting rid of the return statement the code compiles and is correct.

@neboat
Copy link
Collaborator

neboat commented Jan 31, 2019

Glad to hear it.

On my end I'm adding some checks in Tapir-Clang to detect return and break statements in cilk_for loops and to throw compiler errors when such statements are detected. We probably want more front-end checks as well, but these two should take care of several problems.

neboat added a commit that referenced this issue Jan 31, 2019
@neboat
Copy link
Collaborator

neboat commented Feb 1, 2019

The latest version of the WIP-csi-tapir-exceptions branch of Tapir-Clang addresses the issue of return and break statements in cilk_for loops, so I'm closing this issue.

@neboat neboat closed this as completed Feb 1, 2019
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