Repository navigation
JIT: Add flowgraph dumping for new loops - #95748
Conversation
It does not yet support intermixed EH regions and loops (which I think the old stuff does), but this just makes it so we at least can get something for the new loops.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsIt does not yet support intermixed EH regions and loops (which I think the old stuff does), but this just makes it so we at least can get something for the new loops.
|
|
cc @dotnet/jit-contrib PTAL @BruceForstall |
|
I think you shouldn't remove the old loop region graph dumping... yet. Maybe you can add a DOTNET config to dump the old one and make dumping the new one the default? Why couldn't you use the existing Presumably new loops are properly nested within EH regions, or properly encompass entire EH regions, so wouldn't inserting the new loops in the existing RegionGraph as is done with the old loops give support for displaying both? I guess the issue for new loops is loop nesting is not lexical (by block ranges). Although there should still be block-disjoint well-formed loop nesting, and that nesting should be well-formed w.r.t. EH regions. |
That's fair, I can do that.
Right, that's the problem.
While there is some form of nesting property, it is not generally true that EH regions are well-scoped with regards to the parent loops. That is, not all blocks of an EH region inside a loop are necessarily part of the loop. for (int i = 0; i < 100; i++)
{
try
{
// BB01
if (i == 50)
{
// BB02
break;
}
// BB03
Foo();
}
catch
{
// BB04
break;
}
}The loop here contains |
|
I've reintroduced the old loop dumping under |
|
Regarding your example: note that an EH "region" is either the 'try' or the handler, not both: the 'try' and handler are considered separately. So in your example, the loop BB01/BB03 are properly nested within the 'try'. The change is that the RegionGraph as currently implemented depends on BasicBlock bbNum ranges to determine nesting. For new loops, you would have to tell it both the set of blocks in a loop and what the nesting relationship is between a loop and it's parent loop. (Or have a separate implementation entirely, if warranted.) But it's still valid, I think, to be able to represent EH and loop nesting. |
| CONFIG_INTEGER(JitDumpFgDot, W("JitDumpFgDot"), 1) // 0 == dump XML format; non-zero == dump DOT format | ||
| CONFIG_INTEGER(JitDumpFgEH, W("JitDumpFgEH"), 0) // 0 == no EH regions; non-zero == include EH regions | ||
| CONFIG_INTEGER(JitDumpFgLoops, W("JitDumpFgLoops"), 0) // 0 == no loop regions; non-zero == include loop regions | ||
| CONFIG_INTEGER(JitDumpFgOldLoops, W("JitDumpFgOldLoops"), 0) // 0 == no old loop regions; non-zero == include old loop |
There was a problem hiding this comment.
Thanks for adding this.
The regions for the loop and |
|
ok, makes sense. |
It does not yet support intermixed EH regions and loops (which I think the old stuff does), but this just makes it so we at least can get something for the new loops.
Example