Skip to content

[AMDGPU] Add basic patterns to select lshl_or instead of v_perm #65693

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

Closed
wants to merge 1 commit into from

Conversation

jrbyrnes
Copy link
Contributor

@jrbyrnes jrbyrnes commented Sep 7, 2023

It does the operation using fewer sreg.

Also, enables some future commits.

Change-Id: I1c2d8c7ad10011189d66688385f2f40c022f4cf7
@jrbyrnes jrbyrnes requested a review from a team as a code owner September 7, 2023 23:06
@jrbyrnes jrbyrnes requested a review from arsenm September 7, 2023 23:07
Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid emitting a perm in the first place? Can we decompose existing perms into the shift + or? Does computeKnownBits know about AMDGPUperm?

@jrbyrnes
Copy link
Contributor Author

jrbyrnes commented Sep 8, 2023

It was an attempt to delete the hasNon16BitAccesses heuristic, but, after further thought, the heuristic is the correct approach.

This approach is not even correct as it stands: the upper 16 bits of the non-shifted source need to either be provably 0 or masked -- in the latter case, it is better to use a perm. It seems the better approach is to capture the last statement in the heuristic, and avoid / emit the perm accordingly.

computeKnownBits does know about AMDGPUPerm, but there is an outstanding issue.

@jrbyrnes jrbyrnes closed this Sep 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants