Remove MOVE $$locbase, $$sp if non-entry function doesn't use stack#7548
Remove MOVE $$locbase, $$sp if non-entry function doesn't use stack#7548
MOVE $$locbase, $$sp if non-entry function doesn't use stack#7548Conversation
|
👍 |
Merging this PR will degrade performance by 20.27%
Performance Changes
Comparing |
PR SummaryMedium Risk Overview To support this and improve debuggability, instruction sets now carry optional (function name, is_entry) metadata through register allocation/optimization, and emitted ASM comments are standardized into Written by Cursor Bugbot for commit f8651cf. This will update automatically on new commits. Configure here. |
|
Comparing 'e2e-gas-usages':
Comparing 'e2e-bytecode-sizes':
Comparing 'in-language-gas-usages':
Comparing 'bytecode-sizes' for project 'o2':
Comparing 'gas-usages' for project 'o2':
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Description
This PR:
MOVE $$locbase, $$spif non-entry function doesn't use stack at all.register_allocator::spill#7547If the function does not use stack at all, the $$locbase is never used, by definition.
Not using stack at all means that the function:
Having
MOVE $$locbase, $$spin entry functions is a part of compiler's contract and tooling relies on it. Therefore,MOVE $$locbase, $$spremains in entry functions even if$$locbaseis not used.On the contrary, in non-entry functions, setting
$$locbaseis an implementation detail no tooling relies on. E.g. aforc debugor similar.Additionally, the PR:
groups function prologue and epilogue instructions into
[fn/entry init/end]groups for better readability and easier analysis of ASM. Also, it opens the way towards better automatic analysis of ASM output if needed in the future.adapts
filter-fnto use the new[fn/entry init/end: <fn name>]comments.Fixes Register pressure makes compiler panic in
register_allocator::spill#7547.Checklist
Breaking*orNew Featurelabels where relevant.