Skip to content

[BOLT] Make instruction size a first-class annotation #72167

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
Nov 13, 2023

Conversation

maksfb
Copy link
Contributor

@maksfb maksfb commented Nov 13, 2023

When NOP instructions are used to reserve space in the code, e.g. for patching, it becomes critical to preserve their original size while emitting the code. On x86, we rely on "Size" annotation for NOP instructions size, as the original instruction size is lost in the disassembly/assembly process.

This change makes instruction size a first-class annotation and is affectively NFCI. A follow-up diff will use the annotation for code emission.

When NOP instructions are used to reserve space in the code, e.g. for
patching, it becomes critical to preserve their original size while
emitting the code. On x86, we rely on "Size" annotation for NOP
instructions size, as the original instruction size is lost in the
disassembly/assembly process.

This change makes instruction size a first-class annotation and is
affectively NFCI. A follow-up diff will use the annotation for code
emission.
@maksfb maksfb merged commit 2db9b6a into llvm:main Nov 13, 2023
@aaupov
Copy link
Contributor

aaupov commented Nov 13, 2023

Do you think it will have any impact on BOLT's max RSS? If so, it would make sense to enable llvm/llvm-zorg#70

@maksfb
Copy link
Contributor Author

maksfb commented Nov 13, 2023

Do you think it will have any impact on BOLT's max RSS? If so, it would make sense to enable llvm/llvm-zorg#70

If there is, there will be a negligible reduction in max RSS.

@maksfb maksfb deleted the gh-size-annotation branch November 15, 2023 20:28
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
When NOP instructions are used to reserve space in the code, e.g. for
patching, it becomes critical to preserve their original size while
emitting the code. On x86, we rely on "Size" annotation for NOP
instructions size, as the original instruction size is lost in the
disassembly/assembly process.

This change makes instruction size a first-class annotation and is
affectively NFCI. A follow-up diff will use the annotation for code
emission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants