Skip to content

[21.0.0] cranelift: Always consider sret arguments used #8665

Merged
alexcrichton merged 1 commit intobytecodealliance:release-21.0.0from
alexcrichton:backport
May 20, 2024
Merged

[21.0.0] cranelift: Always consider sret arguments used #8665
alexcrichton merged 1 commit intobytecodealliance:release-21.0.0from
alexcrichton:backport

Conversation

@alexcrichton
Copy link
Member

This is a backport of #8664

* cranelift: Always consider sret arguments used

In bytecodealliance#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 the `rets` 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 bytecodealliance#8659

* Review comments
@alexcrichton alexcrichton requested a review from a team as a code owner May 20, 2024 19:29
@alexcrichton alexcrichton requested review from abrown and removed request for a team May 20, 2024 19:29
@alexcrichton alexcrichton enabled auto-merge (squash) May 20, 2024 19:32
@alexcrichton alexcrichton merged commit e882dd8 into bytecodealliance:release-21.0.0 May 20, 2024
@alexcrichton alexcrichton deleted the backport branch May 20, 2024 19:51
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.

3 participants