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

Non-inlined for loops #29

Closed
eponier opened this issue May 31, 2021 · 1 comment
Closed

Non-inlined for loops #29

eponier opened this issue May 31, 2021 · 1 comment

Comments

@eponier
Copy link
Contributor

eponier commented May 31, 2021

For loops whose bounds are not constant are not inlined. Consider, for instance:

export fn main (reg u64 io) -> reg u64 {
  inline int i;
  reg u64 res;
  for i = 0 to (int)io {
    res = i;
  }
  return res;
}

The problem is that some later passes assume that all for loops have been inlined. This program, for instance, is rejected with error:

Fatal error: exception File "src/liveness.ml", line 58, characters 14-20: Assertion failed

I think we should either support this kind of for loops or reject them directly during unrolling.

@bgregoir
Copy link
Contributor

I think it is hard to do it during unrolling (it is an iterative process). But we can add a check after unrolling.

vbgl added a commit that referenced this issue Sep 12, 2022
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