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

[TableGen] Efficiency improvements for encoding HwMode collection. #82902

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

nvjle
Copy link
Contributor

@nvjle nvjle commented Feb 25, 2024

Currently the DecoderEmitter spends a fair amount of cycles performing repeated linear walks over the entire instruction list. This patch eliminates one such walk during HwMode collection for EncodingInfos.

The eliminated traversal visits every instruction and then every EncodingInfos entry for that instruction merely to collect all referenced HwModes. That information already happens to be present in the HwModeSelects created during the one-time construction of CodeGenHwModes. We instead traverse the HwModeSelects, collecting each one referenced as an encoding select. This set is a small constant in size and does not generally grow with the size of the instruction set.

Currently the DecoderEmitter spends a fair amount of cycles performing
repeated linear walks over the entire instruction list. This patch
eliminates one such walk during HwMode collection for EncodingInfos.

The eliminated traversal visits every instruction and then every
EncodingInfos entry for that instruction merely to collect all referenced
HwModes. That information already happens to be present in the HwModeSelects
created during the one-time construction of CodeGenHwModes. We instead
traverse the HwModeSelects, collecting each one referenced as an encoding
select. This set is a small constant in size and does not generally grow
with the size of the instruction set.
@nvjle
Copy link
Contributor Author

nvjle commented Feb 25, 2024

I hope one of @topperc @jyknight @jmolloy @0x59616e @wangpc-pp (based on recent commits or past reviews to the same general area) might review this small patch, thank you.

Copy link
Contributor

@wangpc-pp wangpc-pp left a comment

Choose a reason for hiding this comment

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

LGTM.

@nvjle
Copy link
Contributor Author

nvjle commented Feb 26, 2024

LGTM.

Thank you @wangpc-pp , could I also trouble you to merge on my behalf? (will apply for write access soon, almost enough commits).

@wangpc-pp wangpc-pp merged commit f75c6ed into llvm:main Feb 26, 2024
5 checks passed
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.

None yet

2 participants