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

Peephole Patterns as Objectives #188

Open
philzook58 opened this issue Mar 28, 2022 · 0 comments
Open

Peephole Patterns as Objectives #188

philzook58 opened this issue Mar 28, 2022 · 0 comments

Comments

@philzook58
Copy link
Collaborator

This might be a backwards way of going about this.

Ultimately one of our highest priorities as a patching compiler is code size. The instruction selector has a lot of control about this, the allocator/scheduler almost none. Eventually we intend to have them more integrated.

The one big thing we do that does effect code size is peephole optimization. In particular mov R0 R0 style patterns get fused out we could have other kinds of fusion patterns.

We could internalize these into the allocator/scheduler as part of the objective function. Each peephole pattern has some code size reduction associated to it. An objective function that captures code size is then max sum has_pattern * code_size_reduction.

This is not orthogonal to the concerns of the instruction selector, nor the to-be-implemented notion of "optional" instructions.

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