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

Pass manager/framework for "more local" transformations. #6

Open
eddyb opened this issue Nov 4, 2022 · 1 comment
Open

Pass manager/framework for "more local" transformations. #6

eddyb opened this issue Nov 4, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@eddyb
Copy link
Contributor

eddyb commented Nov 4, 2022

One big limitation in Rust-GPU is that performing inlining for all eligible callsites in a SPIR-V module is a separate monolithic step, but this is very inefficient, because legalizations/simplifications unlocked after individual callsites are inlined can greatly reduce the amount of IR that would be produced after everything is inlined.

In fact, it seems exponentially bad (at least for functions with multiple callsites):

A more efficient design would be to interleave inlining and local transformations (i.e. simplifying a function as much as possible before ever inlining it in turn), but for that there needs to be some kind of framework for "apply these function-local passes repeatedly until they stop wanting to change anything", that can be wrapped in an "IPO" (inter-procedural optimization) pass manager which interleaves it with inlining (and any other "global" changes).

This is itself not a blocker for the initial Rust-GPU integration, but high-priority because it's the bigger win SPIR-T can offer, in terms of reducing Rust-GPU compile times.

Longer-term there are more interesting alternatives like "eqsat" but for now "rerun until fixpoint" seems fine.

@eddyb
Copy link
Contributor Author

eddyb commented Oct 12, 2023

Potentially very relevant: new generalization (to be state-aware) of dataflow:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant