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

CodeEmitter: Various cleanups #4294

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

neobrain
Copy link
Member

@neobrain neobrain commented Jan 22, 2025

The biggest change here is the merger of ForwardLabel and SingleUseForwardLabel by adding a small-vector optimization for the former. In this new version, clang can elide unnecessary std::vector code in principle, but there is still a 0.13% Release binary size overhead since that doesn't always happen in practice.

At runtime we still avoid any unnecessary heap-allocation, so maybe the simpler code is worth it (fewer templates + not having two classes that kinda do the same thing). If not I can take the patch out from the series too. (Arguably it would be handy to have a more generic SmallVector utility that we can use elsewhere too, though.)

The other patches should be uncontroversial.

Binary size changes:

  • Release: 4,209,232 -> 4,214,896 bytes
  • RelWithDebInfo: 36,538,844 -> 36,592,928 bytes
  • Debug: 40,336,248 -> 40,358,536 bytes

Copy link
Member

@Sonicadvance1 Sonicadvance1 left a comment

Choose a reason for hiding this comment

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

Sure.

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