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

Alternative regalloc backends #81

Open
Amanieu opened this issue Sep 20, 2022 · 2 comments
Open

Alternative regalloc backends #81

Amanieu opened this issue Sep 20, 2022 · 2 comments

Comments

@Amanieu
Copy link
Contributor

Amanieu commented Sep 20, 2022

The regalloc2 crate provides a good API (VReg, PReg, Operand, Function, etc) for interacting with a register allocator. It would be nice if other register allocator backends could be made available with the same API to simplify integration on the embedder side.

What I specifically have in mind is a "fast" backend that simply allocates registers in a single pass with the goal of minimizing compilation time. This will have a huge impact on compilation time since my compiler spends 80% of its time in register allocation. In practice I expect to use this for a tiering JIT where hot code can later be re-compiled using the slow regalloc backend that produces better code.

@cfallin
Copy link
Member

cfallin commented Sep 20, 2022

Agreed -- either a linear-scan (in the classical sense, with precomputed live ranges and evicting furthest-future-used values) or a true single-pass allocator (as baseline compilers typically do, evicting all values to stackslots at merge-points and evicting all or per LRU on running out of registers) would be great to have. I don't have the bandwidth to work on this now but I'd be happy to review it if you or someone else wants to work on this.

@Amanieu
Copy link
Contributor Author

Amanieu commented Sep 20, 2022

It's not a high priority for me at the moment, but I'm glad to hear that you're happy to have it as part of the regalloc2 crate.

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

2 participants