Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JIT: preliminary version of profile-based inline policy#44427

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AndyAyersMS merged 2 commits intodotnet:masterfromAndyAyersMS:PGOInlining
Nov 11, 2020

Conversation

@AndyAyersMS
Copy link
Member

Add a new inline policy that can be used when a method has profile data.

It uses the call site frequency to boost profitability. Size and per-call
benefit are currently using the estimates done by the model policy.

Not on by default. Set COMPlus_JitInlinePolicyProfile=1 to enable.
Add testing to weekly experimental runs.

SingleAccretion reacted with thumbs up emojigfoidl reacted with rocket emojinathan-moore, EgorBo, and HurricanKai reacted with eyes emoji
Add a new inline policy that can be used when a method has profile data.It uses the call site frequency to boost profitability. Size and per-callbenefit are currently using the estimates done by the model policy.Not on by default. Set COMPlus_JitInlinePolicyProfile=1 to enable.Add testing to weekly experimental runs.
@Dotnet-GitSync-BotDotnet-GitSync-Bot added the area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labelNov 9, 2020
@AndyAyersMS
Copy link
MemberAuthor

cc @dotnet/jit-contrib

@EgorBo
Copy link
Member

EgorBo commentedNov 9, 2020
edited
Loading

So it fixes#41923 (I've just checked) 🎉

Also, is it expected that it's now able to inline methods with more thanMAX_BASIC_BLOCKS bbs?
because I've just tested this:

stringFoo()=>"hello";[MethodImpl(MethodImplOptions.NoInlining)]boolDoWork(){returnFoo()=="hello";}

Currently, inliner gives up here becausestring.Equals(string,string) has 7 basic blocks and ends up with this forDoWork:

G_M53056_IG01:subrsp,40;; bbWeight=1    PerfScore 0.25G_M53056_IG02:movrcx,0xD1FFAB1Emovrdx, gword ptr[rcx]movrcx,rdxcall     System.String:Equals(System.String,System.String):boolnop;; bbWeight=1    PerfScore 3.75G_M53056_IG03:addrsp,40ret

Your branch (with profile):

G_M53056_IG01:              ;; offset=0000H                                                ;; bbWeight=1    PerfScore 0.00G_M53056_IG02:              ;; offset=0000H       B801000000moveax,1                                                ;; bbWeight=1    PerfScore 0.25G_M53056_IG03:              ;; offset=0005H       C3ret

(basically, fixes#33338)

Copy link
Contributor

@BruceForstallBruceForstall left a comment

Choose a reason for hiding this comment

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

One fix needed in config value string, otherwise LGTM

classProfilePolicy :publicDiscretionaryPolicy
{
public:
// Construct a ModelPolicy
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: copy-paste comment


CONFIG_INTEGER(JitInlinePolicyModel,W("JitInlinePolicyModel"),0)
CONFIG_INTEGER(JitInlinePolicyProfile,W("JitInlinePolicyProfile"),0)
CONFIG_INTEGER(JitInlinePolicyProfileThreshold,W("JitInlinePolicyProfile"),40)
Copy link
Contributor

Choose a reason for hiding this comment

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

String is wrong here: JitInlinePolicyProfile => JitInlinePolicyProfileThreshold

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Thanks for spotting this.

@AndyAyersMS
Copy link
MemberAuthor

is it expected that it's now able to inline methods with more thanMAX_BASIC_BLOCKS bbs

Yes. I'm aiming to have very few arbitrary early limits on what might be inlined, to let the profile data and heuristics determine what's best.

We will need to have some limit on the max IL size we'll consider so that we don't spend time analyzing large methods that can't possibly be good inlines. Not sure what the right value for that limit is just yet; I have it set to 1000 bytes here.

@AndyAyersMS
Copy link
MemberAuthor

Failure seems unrelated; none of this code should be enabled by default.

@AndyAyersMSAndyAyersMS merged commita593f58 intodotnet:masterNov 11, 2020
@AndyAyersMSAndyAyersMS deleted the PGOInlining branchNovember 11, 2020 03:45
@AndyAyersMSAndyAyersMS mentioned this pull requestNov 14, 2020
@ghostghost locked asresolvedand limited conversation to collaboratorsDec 11, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@BruceForstallBruceForstallBruceForstall approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@AndyAyersMS@EgorBo@BruceForstall@Dotnet-GitSync-Bot

[8]ページ先頭

©2009-2025 Movatter.jp