Skip to content

[Go] Align stack-check elision and entry PCDATA with native Go - #78

Merged
zhouguangyuan0718 merged 2 commits into
llvm23.1.masterfrom
review/runtime-stackcheck-parity
Aug 13, 2026
Merged

[Go] Align stack-check elision and entry PCDATA with native Go#78
zhouguangyuan0718 merged 2 commits into
llvm23.1.masterfrom
review/runtime-stackcheck-parity

Conversation

@zhouguangyuan0718

@zhouguangyuan0718 zhouguangyuan0718 commented Aug 13, 2026

Copy link
Copy Markdown

This follows up the runtime stack-growth support merged through #73.

The PR intentionally keeps the work in two reviewable commits:

  1. Elide morestack for final-frame small leaf functions on AArch64 and X86, while keeping the entry ArgsPointerMaps STACKMAP independent. X86 also matches native Go's leaf-like handling of the zero-argument panic helpers, including the extra 8-byte CALL return-PC limit. The LLVM frontend consumes generic SSA, so it does not emit Go DUFFCOPY/DUFFZERO calls; inline memory intrinsics remain call-free instead.
  2. Restore native Go's PCDATA_StackMapIndex entry sentinel of -1. ArgsPointerMaps/LocalsPointerMaps pair 0 is still serialized; runtime getStackMap normalizes -1 to bitmap 0. CFG ranges that return to entry SP depth also return to -1.

This removes the artificial 32-byte AArch64 stack-growth prefix from zero-frame leaf functions without removing their entry argument maps.

The GoALLC LLVM CI test list now includes the leaf-policy, entry-sentinel, and entry-CFG fixtures so the payload jobs exercise these contracts directly.

Validation:

  • Focused leaf/stack-check and sentinel suite: 8/8 passed.
  • Broader Generic/X86/AArch64 GoObj and Go CodeGen suite: 52/52 passed; go-memset-inline was excluded because its stale REP expectation already fails on the X86: Repair Go ABI state at ABI0 boundaries #76 baseline llc.
  • git clang-format --diff reports no changes.

@github-actions

Copy link
Copy Markdown

Hello @zhouguangyuan0718 👋

Thank you for submitting a Pull Request (PR) to the LLVM Project. Since this is your first PR, here are a few useful links covering our main contribution policies and review practices.

  • All contributions to LLVM must follow our LLVM AI Tool Use Policy. In particular, if you used AI while working on this PR, remember to add a note to the PR description.
  • The LLVM Code-Review Policy and Practices document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR.
  • Our LLVM Developer Policy describes our expectations for code quality, commit summaries and contains notes on our CI system.

Please reply to this message to confirm that you have read these policies, especially the LLVM AI Tool Use Policy, and that any AI tool usage has been noted in the PR description.


Frequently asked questions

How do I add reviewers?

This PR will be automatically labeled, and the relevant teams will be notified. For some parts of the project, reviewers may also be added automatically.

You can also add reviewers manually using the Reviewers section on this page. If you cannot use that section, it is probably because you do not have write permissions for the repository. In that case, you can request a review by tagging reviewers in a comment using @ followed by their GitHub username.

What if there are no comments?

If you have not received any comments on your PR after a week, you can request a review by pinging the PR with a comment such as “Ping”. The common courtesy ping rate is once a week. Please remember that you are asking for volunteer time from other developers.

Are any special GitHub settings required to contribute to LLVM?

We only require contributors to have a public email address associated with their GitHub commits, see this section of LLVM Developer Policy for details.


If you have questions, feel free to leave a comment on this PR, or ask on LLVM Discord or LLVM Discourse.

Thank you,
The LLVM Community

@zhouguangyuan0718
zhouguangyuan0718 force-pushed the review/runtime-stackcheck-parity branch from a42d8b1 to ec5f4ef Compare August 13, 2026 17:07
@zhouguangyuan0718
zhouguangyuan0718 merged commit 1d142ac into llvm23.1.master Aug 13, 2026
9 checks passed
@zhouguangyuan0718
zhouguangyuan0718 deleted the review/runtime-stackcheck-parity branch August 13, 2026 17:16
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.

1 participant