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

Change OperationSwap to OperationSet #775

Merged
merged 2 commits into from
Aug 29, 2022
Merged

Change OperationSwap to OperationSet #775

merged 2 commits into from
Aug 29, 2022

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Aug 29, 2022

This commit changes wazeroir.OperationSwap to OperationSet which is the
combination of OperationSwap and Drop in the previous implementation.

Previously, OperationSwap was always followed by OperationDrop on the swapped value on top.
Because of that, we had a redundant register allocation in Swap.

As a result, we use only one register in OperationSet which is a part of translations of
local.tee and local.set.

Signed-off-by: Takeshi Yoneda [email protected]

Signed-off-by: Takeshi Yoneda <[email protected]>
Comment on lines -850 to -851
&OperationSwap{Depth: depth + 2, IsTargetVector: isVector},
&OperationDrop{Depth: &InclusiveRange{Start: 0, End: 1}},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OperationSwap was always followed by Drop, and because of that, we had a redundant register allocation in Swap. That is what this commit resolves.

@mathetake mathetake marked this pull request as ready for review August 29, 2022 05:43
Copy link
Contributor

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the stellar PR desc

@mathetake mathetake merged commit 17b8591 into main Aug 29, 2022
@mathetake mathetake deleted the OperationSet branch August 29, 2022 06:28
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