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

Unit tests for peephole optimizations #2055

Open
ike709 opened this issue Oct 21, 2024 · 0 comments
Open

Unit tests for peephole optimizations #2055

ike709 opened this issue Oct 21, 2024 · 0 comments
Labels
Compiler Involves the OpenDream compiler enhancement New feature or request

Comments

@ike709
Copy link
Collaborator

ike709 commented Oct 21, 2024

#2054 revealed that we had a few optimizations that were never applied, and once that was fixed one of them still didn't work optimally due to how the optimizer functions.

Ideally, we would create some new unit tests that takes bytecode (or DM code?), peephole optimizes it, and then compares the outputted bytecode to an expected output.

Note that we need to be mindful of not using peephole optimizer opcodes in the inputted bytecode, or we may get another situation where PushNull -> Assign -> Pop is only compiled to PushNull -> AssignPop instead of being reduced to just NullRef.

@ike709 ike709 added enhancement New feature or request Compiler Involves the OpenDream compiler labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler Involves the OpenDream compiler enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant