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

pass: remove redundant jump to immediately following label #75

Closed
mmcloughlin opened this issue Apr 9, 2019 · 0 comments · Fixed by #81
Closed

pass: remove redundant jump to immediately following label #75

mmcloughlin opened this issue Apr 9, 2019 · 0 comments · Fixed by #81

Comments

@mmcloughlin
Copy link
Owner

Simple cleanup pass to remove JMP label \n label:\n.

Discussed in #performance on Gophers Slack

https://gophers.slack.com/archives/C0VP8EF3R/p1554774092011200
https://gophers.slack.com/archives/C0VP8EF3R/p1554785110023800

Example:

dgryski/go-chaskey@ba45439#diff-5c275d0467fb567c78cf8a144f8b301bL89

mmcloughlin added a commit that referenced this issue Apr 14, 2019
mmcloughlin added a commit that referenced this issue Apr 16, 2019
mmcloughlin added a commit that referenced this issue Apr 16, 2019
In jump-table-like constructs, the natural way of writing the code can sometimes produce redundant jumps or labels. Therefore some basic cleanup steps have been proposed. This diff adds two transforms:

1. Remove unconditional jumps to a label immediately following.
2. Remove labels with no references at all.

Fixes #75
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 a pull request may close this issue.

1 participant