-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: show profile data for dot flowgraph dumps #42657
Conversation
Also, tweak layout a bit, and update so that if a method is jitted multiple times the files don't overwrite one another. Instead a suffix is added to indicate the kind of jit codegen.
@CarolEidt PTAL. cc @dotnet/jit-contrib Sample output (
|
Also very early on there are no edges as the code relies on pred lists. So wondering if I should instead/in addition use the successor iterator to show edges. (need to look at some EH cases too, suspect handlers will be disconnected). |
@dotnet/jit-contrib thoughts on the following?
|
@dotnet/jit-contrib anyone want to take a look? Feedback on options noted above is welcome. |
I'd be in favor of always showing a normalized count. I can't imagine it would be terribly difficult, though I can imagine that it might be imperfect - I think that it makes the visualization much easier to reason about. |
break; | ||
default: | ||
// These may or may not have an edge to the next block. | ||
// Add a transparent edge to keep nodes ordered. |
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.
Although I realize that it may not always be the best layout, I find it so much easier to reason about these graphs when the nodes are in sequential order by bbNum
. IIRC this was an imperfect mechanism for doing so, but it mostly worked.
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.
So you'd like to see a spine of blocks in increasing bbNum order? I can add the invisible edges back.
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.
Yes, that would be my preference, unless there's consensus against it.
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.
Internal blocks like a loop preheader block have a high number at the are allocated as the highest block number. (Until we renumber the blocks)
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.
My preference is to have the fall through block always be a short straight line down to the next block:
block A ------ taken branch
|
|
block B ------- taken branch
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 can do invisible edges to encourage bbNext
order, that will give bbNum
order if you've recently renumbered, and bbNext
order otherwise.
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.
That sounds great to me.
One issue with always showing normalized counts is that we currently have to do a bunch of work to compute the true method entry count because we don't cleanly handle the case where IL offset 0 is a branch target during instrumentation. I plan to fix this but we need to be a bit careful because we also would like to remain backwards compatible with the legacy IBC scheme. So we currently have 3 phases of "evolution" of the flow graph with profile data:
I intend to have the jit start building a more fully descriptive flow graph earlier, but it will take some work. But if we can get at the "called count" simply from instrumentation then we can have normalized weights from the start, without needing pred edges or pred edge weights. |
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.
LGTM
Here's what the above would look like with invisible heavy-weight |
Yes, precisely - thanks! |
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.
LGTM - thanks!
Also, tweak layout a bit, and update so that if a method is jitted
multiple times the files don't overwrite one another. Instead a
suffix is added to indicate the kind of jit codegen.