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 basic optimizations #88

Closed
jserv opened this issue Dec 7, 2023 · 4 comments
Closed

Implement basic optimizations #88

jserv opened this issue Dec 7, 2023 · 4 comments
Assignees

Comments

@jserv
Copy link
Collaborator

jserv commented Dec 7, 2023

With the inclusion of SSA in the middle-end, it is now time to implement some common optimizations on the new SSA-based IR. These include constant folding, copy propagation, and dead code elimination.

@jserv
Copy link
Collaborator Author

jserv commented Mar 2, 2024

After @vacantron implements the constant folding optimization, this task will be considered complete, signifying that shecc achieves the goal of implementing a minimal optimizing C compiler capable of compiling itself with typical optimizations.

@vacantron
Copy link
Collaborator

vacantron commented Mar 3, 2024

Should we abjust the directory structure that making src/ssa.c focus on building the SSA and create another src/optimizer.c to include the existent src/peephole.c and the other optimizers ?

@jserv
Copy link
Collaborator Author

jserv commented Mar 3, 2024

Should we abjust the directory structure that making src/ssa.c focus on building the SSA and create another src/optimizer.c to include the existent src/peephole.c and the other optimizers ?

Up to you. I expect the availability of basic optimizers existing with minimal efforts.

@jserv
Copy link
Collaborator Author

jserv commented Aug 15, 2024

So far, we have implemented a few optimizations:

  • Common subexpression elimination
  • Constant optimization
  • Peephole optimization
  • Dead code elimination

With these optimizations complete, we consider this task concluded. Dedicated issues will be created for any additional optimizations as they are planned.

@jserv jserv closed this as completed Aug 15, 2024
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

No branches or pull requests

3 participants