- Notifications
You must be signed in to change notification settings - Fork5.2k
Inliner: new observations (don't impact inlining for now)#53670
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
da5d989 tod12eed8CompareEgorBo commentedJun 3, 2021
@dotnet/jit-contrib@AndyAyersMS Please, take a look. |
Uh oh!
There was an error while loading.Please reload this page.
AndyAyersMS left a comment
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.
Some of the inline policies that derive from theDefaultPolicy should probably also implement the new per-policy xml dumping methods (invoking the parent version, then adding their own unique entries at the end).
Previously I'd dumped the data as a separate side file; keeping it inline with the xml makes sense. It feels like there might be cleaner ways to implement all this but I'm not sure it is worth the trouble. Better to focus on what we do with the data.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
EgorBo commentedJun 7, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@AndyAyersMS could you please re-review?
Do you mind if I leave it as is for now, the per-policy XML stuff is not included by default if I'm currently rewriting#52708 to be based on this PR |
…-improvements-noperf
39825f9 toc2a94a2Compare
AndyAyersMS left a comment
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.
Do you mind if I leave it as is for now, the per-policy XML stuff is not included by default
Sure, we can fix this later.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Andy Ayers <andya@microsoft.com>
EgorBo commentedJun 8, 2021
@AndyAyersMS could you please re-review, I've addressed your feedback. |
AndyAyersMS left a comment
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.
Looks good overall. Let's just make sure we get the right check for generic methods.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
EgorBo commentedJun 8, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
A test for generics: usingSystem;classProgram{staticvoidMain(){Console.WriteLine(GenericClass<string>.Case1(1));Console.WriteLine(GenericClass<string>.Case2(1));Console.WriteLine(GenericClass<long>.Case1(1));Console.WriteLine(GenericClass<long>.Case2(1));Console.WriteLine(NonGenericClass.Case3<int>(1));Console.WriteLine(NonGenericClass.Case3<string>(""));}}publicclassGenericClass<T>{// Case1: class is a [shared] generic, method doesn't use TpublicstaticintCase1(inta){if(a==42)thrownewException("hello");// some random code to exceed ALWAYS_INLINE limitreturn0;}// Case2: class is a [shared] generic, method uses TpublicstaticintCase2(inta){if(typeof(T)==typeof(float))thrownewException("hello");// some random code to exceed ALWAYS_INLINE limitreturn0;}}publicclassNonGenericClass{// Case3: class is not generic, method ispublicstaticintCase3<T>(Ta){if(aisfloat)thrownewException("hello");// some random code to exceed ALWAYS_INLINE limitreturn0;}} |
AndyAyersMS left a comment
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.
I still think the interesting case is when caller is not shared (generic or no) and callee is shared, but let's see how this plays out when you add heuristics based on these observations.
EgorBo commentedJun 9, 2021
Will check that case separately too |
Uh oh!
There was an error while loading.Please reload this page.
Extracted from#52708
Without changes which impact inlining decisions.
Empty jit diffs (as expected).