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

[asmgen] generate code for stack argument access differently #6651

Merged
merged 12 commits into from
Oct 24, 2024

Conversation

vaivaswatha
Copy link
Contributor

To save excess arguments on the stack, previously we would

  1. store the argument using SW with an immediate offset basing from locals-base register. This limits the offset to 12 bits.
  2. Store the offset to the first excess argument to the last ARG register so that callee can access these.

This PR reverses the order. It stores the offset to the last ARG register first. Then the store of argument to the stack slot can be made without requiring large immediate offsets, basing just on the last ARG register.

Fixes #6646

To save excess arguments on the stack, previously we would
  1. store the argument using SW with an immediate offset
  basing from locals-base register. This limits the offset
  to 12 bits.
  2. Store the offset to the first excess argument to
  the last ARG register so that callee can access these.

This PR reverses the order. It stores the offset to the last
ARG register first. Then the store of argument to the stack
slot can be made without requiring large immediate offsets,
basing just on the last ARG register.

Fixes #6646
@vaivaswatha vaivaswatha self-assigned this Oct 17, 2024
Copy link

codspeed-hq bot commented Oct 17, 2024

CodSpeed Performance Report

Merging #6651 will degrade performances by 23.99%

Comparing vaivaswatha/issue6646 (6f951db) with master (a110a95)

Summary

❌ 1 regressions
✅ 21 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master vaivaswatha/issue6646 Change
goto_definition 1.6 ms 2.1 ms -23.99%

@vaivaswatha vaivaswatha marked this pull request as ready for review October 17, 2024 02:52
@vaivaswatha vaivaswatha requested a review from a team as a code owner October 17, 2024 02:52
IGI-111
IGI-111 previously approved these changes Oct 17, 2024
@IGI-111 IGI-111 requested a review from a team October 17, 2024 20:38
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Should we add the test program from the original issue to our test suite?

@vaivaswatha
Copy link
Contributor Author

Should we add the test program from the original issue to our test suite?

Done.

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@vaivaswatha vaivaswatha requested a review from IGI-111 October 24, 2024 03:05
@IGI-111 IGI-111 merged commit d6b9def into master Oct 24, 2024
40 checks passed
@IGI-111 IGI-111 deleted the vaivaswatha/issue6646 branch October 24, 2024 11:41
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.

Codegen panics on too many arguments on large binaries
3 participants