Skip to content

[BOLT] CDSplit main logic part 1/2 #73895

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 3 commits into from
Dec 1, 2023

Conversation

ShatianWang
Copy link
Contributor

@ShatianWang ShatianWang commented Nov 30, 2023

This diff defines and initializes auxiliary variables used by CDSplit and implements two important helper functions. The first helper function approximates the block level size increase if a function is hot-warm split at a given split index (X86 specific). The second helper function finds all calls in the form of X->Y or Y->X for each BF given function order [... X ... BF ... Y ...]. These calls are referred to as "cover calls". Their distance will decrease if BF's hot fragment size is further reduced by hot-warm splitting. NFC.

@ShatianWang ShatianWang marked this pull request as ready for review November 30, 2023 04:08
@ShatianWang ShatianWang requested a review from maksfb November 30, 2023 04:09
@ShatianWang ShatianWang force-pushed the 112923GHCommit5AuxiVars branch from f9b373d to d1bc831 Compare November 30, 2023 04:47
This diff defines and initializes auxiliary variables used by CDSplit
and implements two important helper functions. The first helper function
approximates the block level size increase if a function is hot-warm
split at a given split index (X86 specific). The second helper function
finds all calls in the form of X->Y or Y->X for each BF given function
order [... X ... BF ... Y ...]. These calls are referred to as "cover
calls". Their distance will decrease if BF's hot fragment size is
further reduced by hot-warm splitting. NFC.
@ShatianWang ShatianWang force-pushed the 112923GHCommit5AuxiVars branch from d1bc831 to 3d4b26e Compare November 30, 2023 16:36
@ShatianWang ShatianWang changed the title [BOLT] Initialize auxiliary variables for CDSplit [BOLT] CDSplit main logic part 1/2 Nov 30, 2023
Comment on lines 209 to 211
uint8_t BRANCH_SIZE = 0;
uint8_t LONG_UNCOND_BRANCH_SIZE_DELTA = 0;
uint8_t LONG_COND_BRANCH_SIZE_DELTA = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for these variables to use a different naming scheme?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used capitalization because these variables are "constants" that depend on the architecture. I can change them to match the rest of the variable naming scheme if it is confusing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use camel case to follow LLVM coding standards.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@maksfb maksfb left a comment

Choose a reason for hiding this comment

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

LGTM

@ShatianWang ShatianWang merged commit 56bbf81 into llvm:main Dec 1, 2023
@ShatianWang ShatianWang deleted the 112923GHCommit5AuxiVars branch December 21, 2023 05:36
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