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

Implement more peephole optimizations #52

Open
1 of 4 tasks
polsys opened this issue Mar 2, 2019 · 0 comments
Open
1 of 4 tasks

Implement more peephole optimizations #52

polsys opened this issue Mar 2, 2019 · 0 comments
Labels
area-Optimization Optimization of the intermediate or final code. type-Enhancement Improvement to an existing feature.
Milestone

Comments

@polsys
Copy link
Owner

polsys commented Mar 2, 2019

Some optimizations that could be applied even in non-optimizing builds, since the peephole optimizer covers up a lot of inefficient lowering:

  • Replace "load immediate to %2, do arithmetic with %1 and %2" with "do arithmetic with %1 and imm"
  • Replace multiplication and unsigned division with a power of 2 with shifts
  • Replace "move %1 to %3, do arithmetic with %2 and %3" with "do arithmetic with %2 and %1" where possible
  • Replace "jcc next_block, jmp somewhere" with "jncc somewhere, jmp next_block" so that the latter jump can be elided in codegen
@polsys polsys added type-Enhancement Improvement to an existing feature. area-Optimization Optimization of the intermediate or final code. labels Mar 2, 2019
@polsys polsys added this to the 0.2 milestone Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Optimization Optimization of the intermediate or final code. type-Enhancement Improvement to an existing feature.
Projects
None yet
Development

No branches or pull requests

1 participant