jameysharp opened PR #8664 from jameysharp:fix-8659
to bytecodealliance:main
:
In #8438 we stopped emitting register bindings for unused arguments, based on the use-counts from
compute_use_states
. However, that doesn't count the use of the struct-return argument that's automatically added after lowering when therets
instruction is generated in the epilogue. As a result, using a struct-return argument caused register allocation to panic due to the VReg not being defined anywhere.This commit adds a use to the struct-return argument so that it's always available in the epilogue.
Fixes #8659
jameysharp requested wasmtime-compiler-reviewers for a review on PR #8664.
jameysharp requested fitzgen for a review on PR #8664.
cfallin submitted PR review:
LGTM!
cfallin submitted PR review:
LGTM!
cfallin created PR review comment:
Could we add a comment here to note it starts at
Once
(for the one use that is the implicit return), but can still be updated below?
jameysharp submitted PR review.
jameysharp created PR review comment:
Actually, should I just start it at
Multiple
in case there are multiple epilogues? The definition of the sret vreg can't participate in load-sinking or anything so I don't think the value really matters, but I guess it should be "correct" anyway?
cfallin submitted PR review.
cfallin created PR review comment:
Oh, yes, that makes more sense actually, I agree. It's unlikely to matter as you say but might as well get the analysis right...
jameysharp updated PR #8664.
jameysharp has enabled auto merge for PR #8664.
jameysharp merged PR #8664.
Last updated: Nov 22 2024 at 17:03 UTC