Skip to content

[CodeGenTypes] Speed up getVectorElementType and getVectorMinNumElements #95282

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

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Jun 12, 2024

Implement MVT::getVectorElementType and MVT::getVectorMinNumElements with table lookup instead of switch.

This speeds up "check-llvm-codegen-amdgpu" by about 7% in my Release build.

Implement MVT::getVectorElementType and MVT::getVectorMinNumElements
with table lookup instead of switch.

This speeds up "check-llvm-codegen-amdgpu" by about 7% in my Release
build.
@jayfoad jayfoad requested review from nikic and chapuni June 12, 2024 18:11
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

LGTM

@jayfoad jayfoad requested a review from Pierre-vh June 12, 2024 18:51
@jayfoad
Copy link
Contributor Author

jayfoad commented Jun 12, 2024

This speeds up "check-llvm-codegen-amdgpu" by about 7% in my Release build.

The reason it has such a large effect on the AMDGPU test suite is that a huge number of those tests use -verify-machineinstrs, and when MachineVerifier verifies a COPY instruction it calls TRI->getMinimalPhysRegClassLLT on both operands.

@jayfoad jayfoad merged commit abedb3b into llvm:main Jun 12, 2024
6 of 7 checks passed
@jayfoad jayfoad deleted the perf/mvt-speedup branch June 12, 2024 19:08
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