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

[InstrProf] Correct buffer size for encodeULEB128 #67011

Merged
merged 1 commit into from
Sep 26, 2023
Merged

[InstrProf] Correct buffer size for encodeULEB128 #67011

merged 1 commit into from
Sep 26, 2023

Conversation

kaz7
Copy link
Contributor

@kaz7 kaz7 commented Sep 21, 2023

This function uses 16 bytes buffer to encode two 64 bits data. However, the encoding method requires 10 bytes to encode one 64 bits data, so encoded data actually requiress 20 bytes total.

I send a patch about this at https://bugs.llvm.org/show_bug.cgi?id=37447, but it is left as is. So I'm submitting the patch again. I personally recommend to remove encodeULEB128 with buffer version and use only encodeULEB128 with stream version.

This function uses 16 bytes buffer to encode two 64 bits data.
However, the encoding method requires 10 bytes to encode one 64 bits
data, so encoded data actually requiress 20 bytes total.

I send a patch about this at https://bugs.llvm.org/show_bug.cgi?id=37447,
but it is left as is.  So I'm submitting the patch again.  I personally
recommend to remove encodeULEB128 with buffer version and use only
encodeULEB128 with stream version.
Copy link
Contributor

@ellishg ellishg left a comment

Choose a reason for hiding this comment

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

LGTM

@kaz7 kaz7 merged commit 418e441 into llvm:main Sep 26, 2023
2 checks passed
@kaz7 kaz7 deleted the main-fix-instrprof-bug branch September 26, 2023 01:16
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

3 participants