runtime

Debugging Compiler Dependency Analysis

The general technique is to identify what node is missing from the graph, or is erroneously present in the graph, and change the dependency analysis logic to adjust the graph. This document describes the various ways of debugging to identify what’s happening.

Analysis techniques for the dependency graph:

Dependency Graph Viewer

This application allows viewing the dependency graph produced by the AOT compilation.

Usage instructions:

  1. Launch the process as an administrator.
  2. Run the compiler. The compiler can be run to completion, or stopped.
  3. Explore through the graph.

Graphs View

Dependency Graph View

Single Node Exploration

Why DGML

This tool can be used to visualize paths from a node of interest to the roots. To use it, pass command line option to the compiler to generate the DGML file (--dgmllog name_of_output_file) and then use this tool to find the path to the root. If you’re looking at an optimized NativeAOT compilation, --scandgmllog might be preferable since it will have more details.

The input to the tool is the DGML file and name of a node of interest. The output is the list of reasons why that node was included.

This tool located in folder src/coreclr/tools/aot/WhyDgml

See https://github.com/dotnet/corert/pull/7962 for example of usage and output.