Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Improve jit tailcall decision reporting #26149

Merged
merged 12 commits into from
Sep 16, 2019

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Aug 13, 2019

On platforms with unsupported helper, report the reason why we did not
do a fast tailcall instead of just the general reason that we couldn't.

On Windows we might also consider both reporting a fail decision and a success reason when we end up doing a slow tailcall, so that we record the reason a fast tailcall wasn't done. There is also a "reason" field in the success decision that we could use instead. Thoughts?

cc @jashook

On platforms with unsupported helper, report the reason why we did not
do a fast tailcall instead of the fact that no copy args thunk is
available.
@jakobbotsch jakobbotsch marked this pull request as ready for review August 13, 2019 23:06
@jakobbotsch jakobbotsch changed the title [WIP] Improve jit tailcall decision reporting Improve jit tailcall decision reporting Aug 13, 2019
@jashook
Copy link

jashook commented Aug 14, 2019

@jakobbotsch please confirm this change has no diffs when possible.

Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

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

lgtm

@jakobbotsch
Copy link
Member Author

jakobbotsch commented Aug 14, 2019

@jakobbotsch please confirm this change has no diffs when possible.

Yep, 0 diffs over {unix x64, windows x64, windows x86} x {crossgen, pmi}.

@jakobbotsch
Copy link
Member Author

Also cc @dotnet/jit-contrib.

@jashook
Copy link

jashook commented Sep 4, 2019

@jakobbotsch can you fix the conflicts? We can merge after that is done.

@jakobbotsch
Copy link
Member Author

@BruceForstall @jashook PTAL again, the parts in fgMorphCall moved to fgMorphPotentialTailCall and changed significantly due to my refactoring in #26158.

@jashook
Copy link

jashook commented Sep 4, 2019

/azp run coreclr-outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@CarolEidt
Copy link

It might be useful to declare an enum as for INLINE_OBSERVATION (in inline.def), though perhaps that's overkill for this purpose. It would make it easier to log these decisions.

@jakobbotsch
Copy link
Member Author

I think the main difference between inlining and tailcall decisions is that the inlining observations are also used to guide the decisions while for tailcalls the string is purely for logging. I don't know if an enum would add much due to that. However it could certainly be useful in the future if/when we decide to do more profitability checks for fast tailcalls.

@CarolEidt
Copy link

@jakobbotsch - I wasn't so much interested in how the JIT might use the decisions, but how the JIT might expose them in event logging. I'm not sure at this point how useful that might be, and probably something that can be considered in future.

@jakobbotsch
Copy link
Member Author

If I'm not wrong I think even the inlining decisions are reported as strings in event logging, not as enum values. The enum values are only used internally I believe.

@CarolEidt
Copy link

CarolEidt commented Sep 5, 2019

Thanks; I didn't realize they were even being reported in event logging. It seems to me that we might want to be more concise in event logs than using strings, but in any event I don't think it's something to hold this up over (and I didn't intend to; it was just a passing thought)

@AndyAyersMS
Copy link
Member

We have used strings for inline reporting forever, and they have some very nice advantages -- minor changes to the string text, or adding or removing new types is simple. If we used enums we'd need to make changes in the runtime each time we did this, and it would create versioning issues for diagnostic tools, as the meaning of enums might now be jit or runtime version-dependent.

My only real complaint on the inlining side is that failure reasons generated by the runtime don't get propagated back to the jit, so we just get a generic "VM said no" failure instead of something more specific.

@jakobbotsch
Copy link
Member Author

The failing test also seems to be failing in other outerloop runs. This should be good to go.

@jashook
Copy link

jashook commented Sep 16, 2019

Correct it is #26013

@jashook jashook merged commit 58addf0 into dotnet:master Sep 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants