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

stack alloc: relax the checker #841

Merged
merged 1 commit into from
Jun 19, 2024
Merged

stack alloc: relax the checker #841

merged 1 commit into from
Jun 19, 2024

Conversation

eponier
Copy link
Contributor

@eponier eponier commented Jun 18, 2024

Before this patch, an assignment a = b, where a and b are two arrays, was allowed only if b was fully valid, and a was marked as fully valid too. After this patch, b does not need to be fully valid, and a is marked as having the same validity as b.

The motivation was to enable more freedom in the spilling of reg ptr. In particular, I needed the following pattern to be accepted.

reg ptr u64[N*K] r;
reg ptr u64[N] p;

for i = 0 to K {
  p = r[N*i:N];
  () = #spill (r); // f is using a lot of registers, so we have to spill as much as we can
  p = f (p);
  () = #unspill (r); // r is not fully valid due to the call, so this was rejected before
  r[N*i:N] = p;
}

Before this patch, an assignment a = b, where a and b are two arrays,
was allowed only if b was fully valid, and a was marked as fully valid
too. After this patch, b does not need to be fully valid, and a is
marked as having the same validity as b.
@eponier
Copy link
Contributor Author

eponier commented Jun 18, 2024

I had a hard time trying to describe the change in the changelog, without entering the details of the checker. If you have a better formulation, then go ahead.

@eponier
Copy link
Contributor Author

eponier commented Jun 18, 2024

Also, I put the new tests in a x86-64 subfolder because there were tests on subarrays there, but what is tested is not x86-specific.

@bgregoir bgregoir merged commit cc0fdc2 into main Jun 19, 2024
1 check passed
@bgregoir bgregoir deleted the relax-stkalloc branch June 19, 2024 14:25
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

Successfully merging this pull request may close these issues.

2 participants