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

Implement dead code elimination/value numbering for shuffles #10

Open
rachitnigam opened this issue Feb 12, 2020 · 3 comments
Open

Implement dead code elimination/value numbering for shuffles #10

rachitnigam opened this issue Feb 12, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@rachitnigam
Copy link
Member

We should run DCE after register allocation and shuffle truncation. We generate quite a few unnecessary registers.

@avanhatt avanhatt added the enhancement New feature or request label Feb 25, 2020
@avanhatt
Copy link
Contributor

This would be good to do for human-readability of the kernels Vincent is generating (mostly in removing the statically specified shuffle arrays that are rendered dead).

@avanhatt avanhatt changed the title Implement dead code elimination Implement dead code elimination/value numbering May 6, 2021
@avanhatt
Copy link
Contributor

avanhatt commented May 6, 2021

There are a few different places in the code this could slot in:

Currently, shuffle-truncation-pass.rkt is where these shuffle indices are created, so we could handle deduplication there. Alternatively, we could add a new dead-code-elminiation-pass.rkt file to do just the deduplication and dead code elimination passes there. That pass would get called from compiler.rkt

@avanhatt avanhatt changed the title Implement dead code elimination/value numbering Implement dead code elimination/value numbering for shuffles May 13, 2021
@avanhatt
Copy link
Contributor

One path forward: starting in shuffle-truncation-pass.rkt, build a map of final are already seen, and reference an existing shuffle instead of building a new duplicate one where possible. Then have a second pass to make sure any other "dead" shuffles are removed (likely working through the list of instructions backwards, removing any shuffle declaration where you haven't seen a use).

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

3 participants