Uh oh!
There was an error while loading. Please reload this page.
Inliner: new observations (don't impact inlining for now) - #53670
Conversation
Uh oh!
There was an error while loading. Please reload this page.
da5d989 to
d12eed8CompareEgorBo
commented
Jun 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.
Some of the inline policies that derive from the DefaultPolicy 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.
@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 to
c2a94a2Compare
AndyAyersMS
left a comment
There was a problem hiding this comment.
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
commented
Jun 8, 2021
@AndyAyersMS could you please re-review, I've addressed your feedback. |
AndyAyersMS
left a comment
There was a problem hiding this comment.
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.
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.
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
commented
Jun 9, 2021
Will check that case separately too |
Extracted from #52708
Without changes which impact inlining decisions.
Empty jit diffs (as expected).