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

Testing optimizer (and more generally, AST modifier) #1301

Open
shirok opened this issue Oct 10, 2024 · 0 comments
Open

Testing optimizer (and more generally, AST modifier) #1301

shirok opened this issue Oct 10, 2024 · 0 comments

Comments

@shirok
Copy link
Collaborator

shirok commented Oct 10, 2024

Is there an agreed strategy to test if particular optimizer is working as supposed? Coalton-level functional tests don't cut it, for optimized code should behave functionally equivalent to the unoptimized one.

In my Scheme implementation where Scheme is compiled to VM code, the tests examine the VM instruction sequence (using pattern match) to see if optimizer is working.

In Coalton, we can either (1) examine the generated Lisp code, or (2) extract the rewritten AST and examine it. I prefer looking at AST, for it won't be affected by the changes in the later codegen passes. But test code needs to know the internals of AST.

It may also be convenient to have a general mechanism to turn on/off particular optimizations.

If this has been discussed before, could you point me the reference? Thanks.

@shirok shirok changed the title Testing optimizer (and more generally, code generator) Testing optimizer (and more generally, AST modifier) Oct 10, 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

1 participant