Skip to content

Conversation

MichalStrehovsky
Copy link
Member

So that we have this for statistics or visualizations when needed.

Cc @dotnet/ilc-contrib

So that we have this for statistics or visualizations when needed.
@Copilot Copilot AI review requested due to automatic review settings July 9, 2025 12:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for reporting folded method bodies in the MSTAT output to improve downstream statistics and visualizations.

  • Introduces a GetName API on IDependencyNode and implements it in core framework types.
  • Adds a ReportFoldedNode hook to the object-dumping infrastructure and invokes it in the object writer.
  • Enhances MstatObjectDumper to collect, encode, and emit deduplicated method-body mappings.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs Added GetName method to the dependency-node interface
src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/DependencyNodeCore.cs Explicit interface implementation for the new GetName method
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ReachabilityInstrumentationProvider.cs Provided a GetName implementation on UntrackedSymbol
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs Reports folded symbol nodes via ReportFoldedNode
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDumper.cs Added default ReportFoldedNode in the dumper base class
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MstatObjectDumper.cs Tracks and emits deduplicated method-body data
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/IObjectDumper.cs Declared new ReportFoldedNode in dumper interface
Comments suppressed due to low confidence (4)

src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs:44

  • [nitpick] Consider adding an XML doc comment for the new GetName method to explain its purpose and expected return value.
        string GetName(DependencyContextType context);

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDumper.cs:19

  • [nitpick] Add XML documentation to explain when and why ReportFoldedNode is called and how implementations should handle it.
        public virtual void ReportFoldedNode(NodeFactory factory, ObjectNode originalNode, ISymbolNode targetNode) { }

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/IObjectDumper.cs:11

  • [nitpick] Consider adding an XML doc comment to the interface method to describe its contract and potential side effects.
        void ReportFoldedNode(NodeFactory factory, ObjectNode originalNode, ISymbolNode targetNode);

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MstatObjectDumper.cs:183

  • New logic for collecting and encoding deduplicated method bodies should be covered by a unit or integration test to verify the MSTAT output includes the expected DeduplicatedMethods section.
            var deduplicatedMethods = new InstructionEncoder(new BlobBuilder());

Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@MichalStrehovsky
Copy link
Member Author

@sbomer is this something you'd be comfortable reviewing?

@MichalStrehovsky
Copy link
Member Author

/ba-g wasm deadletters

@MichalStrehovsky MichalStrehovsky merged commit 9c3a1bc into dotnet:main Jul 18, 2025
108 of 115 checks passed
@MichalStrehovsky MichalStrehovsky deleted the mstatfold branch July 18, 2025 10:25
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants