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

[BOLT] Deduplicate equal offsets in BAT #76905

Merged
merged 16 commits into from
Jan 25, 2024

Conversation

aaupov
Copy link
Contributor

@aaupov aaupov commented Jan 4, 2024

Encode BRANCHENTRY bits as bitmask for deduplicated entries.

Reduces BAT section size:

  • large binary: to 11834216 bytes (0.31x original),
  • medium binary: to 1565584 bytes (0.26x original),
  • small binary: to 336 bytes (0.23x original).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test

Copy link

github-actions bot commented Jan 4, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
}
if (BEBitMask)
delete BEBitMask;
Copy link
Member

Choose a reason for hiding this comment

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

Can you make this automatically memory managed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I can keep APInt uninitialized if it's not used.

if (OutputOffset == InputOffset)
++EqualOffsets;
else
break;
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to stop here at the first offset that's different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's by design. The idea is that if OutputOffset==InputOffset, only emit one of them. It's expected that if offsets start to diverge at some point, they're not reconverging.

Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

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

LG

@aaupov aaupov changed the base branch from users/aaupov/spr/main.bolt-deduplicate-equal-offsets-in-bat to main January 25, 2024 23:36
@aaupov aaupov merged commit df7d2b2 into main Jan 25, 2024
10 checks passed
@aaupov aaupov deleted the users/aaupov/spr/bolt-deduplicate-equal-offsets-in-bat branch January 25, 2024 23:37
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.

3 participants