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] Refactor fixBranches() #73752

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Conversation

maksfb
Copy link
Contributor

@maksfb maksfb commented Nov 29, 2023

Simplify code in fixBranches(). Mostly NFC, accept the x86-specific check for code fragments now takes into account presence of more than two fragments. Should only matter when we split code into multiple fragments and can run fixBranches() more than once.

Also, don't replace a branch target with the same one, as such operation may allocate memory for extra MCSymbolRefExpr.

Simplify code in fixBranches(). Mostly NFC, accept the x86-specific
check for code fragments now takes into account presence of more than
two fragments. Should only matter when we split code into multiple
fragments and can run fixBranches() more than once.

Also, don't replace a branch target with the same one, as such operation
may consumes memory needed for MCSymbolRefExpr.
Copy link
Contributor

@ShatianWang ShatianWang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@maksfb maksfb merged commit 4bcbbe1 into llvm:main Nov 30, 2023
4 checks passed
@maksfb maksfb deleted the gh-refactor-fix-branches branch November 30, 2023 22:34
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.

None yet

2 participants