-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Enable aggressive inlining in MSVC #117182
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
base: main
Are you sure you want to change the base?
Conversation
@MichalPetryka nice tp diffs! What is the size diff for the resulting binaries? |
From what I see it adds ~10% to binary size for JIT (x64 and arm64) for ~3% TP improvement. @dotnet/jit-contrib @jkotas opinions? |
It's not clear what the impact of something like this will be when PGO is enabled (which it isn't in the superpmi runs). |
PGO would ignore |
Yeah this matches my observation that only alt jits were affected, coreclr.dll and clrjit.dll were not affected (same size). |
I can see two justifications for this change:
In any case, I do not think we want to make this change for checked JIT. It would make checked JIT harder to debug. |
@MichalPetryka, please address this feedback. |
Wouldn't having different configuration between Checked and Release also cause issues by potentially causing configuration specific bugs? |
Checked and Release compile very different code due to all ifdef DEBUG. We do introduce bugs every once a while that make checked and release observable behaviors to not match, and I believe we have outer loop tests to catch these. I am not sure why it is relevant here. |
|
||
void Compiler::impPushOnStack(GenTree* tree, typeInfo ti) | ||
{ | ||
// dummy diff to trigger SPMI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// dummy diff to trigger SPMI |
I'm just confused what it does then. It seems to be improving the alt jits only which can result in faster AOT compilation, but does it mean we just don't provide Native PGO to those? Since Native PGO effectively makes Ob3 no-op |
Not opposite of taking this, leaving for @jkotas to comment |
This is performance related change. I would like to see some numbers for what it is improving. Performance related changes without numbers have high probability of being performance regressions in practice. |
Spmi TP-diff reports significant wins ("instructions retired" which in most cases is correlated with the performance) and I assume it's not because of less inlines (this mode should be more aggressive), but I agree it'd nice to measure something |
Don't we use non-PGO release builds for those TP-diff jits (to try and mitigate the effects of possibly mismatched PGO in the diff)? So it's not really telling us what product impact would be. My experience is that once you enable PGO, extra tweaking like this is rarely an improvement. We should ask the MSVC team what they'd recommend. |
@AndyAyersMS yes, but it seems we don't apply it for altjit because when I applied this fix locally and built with Release (and didn't disable NativePGO) only atljits were affected. coreclr.dll and clrjit.dll were intact. |
This pull request has been automatically marked |
Try enabling more aggressive inlining to see TP diffs.
cc @EgorBo