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
cmd/compile/internal/ssa: regalloc handles arguments poorly #14597
Comments
I'm working on this one. |
It's more general than just args, any read-only use of a value within a loop has this problem at the moment. |
Weird. I just tried
and that produces a load into y which is registerized across the entire function. If you make |
Right. Reading a global forces the load to happen before the loop starts. |
This is fixed, probably by https://go-review.googlesource.com/c/20151/ |
compiling this function with SSA
produces this output after regalloc
v34(len(src)) and v39(ptr(src)) both get loaded inside the loop body, even though their assigned registers are free for the entire function. I suspect it's because Arg values are handled as pre-spilled.
The text was updated successfully, but these errors were encountered: