Skip to content

Conversation

@MichalStrehovsky
Copy link
Member

Fixes #114093.

Cc @dotnet/ilc-contrib

Copilot AI review requested due to automatic review settings April 16, 2025 12:37
Copy link
Contributor

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.

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

Files not reviewed (2)
  • src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj: Language not supported
  • src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj: Language not supported
Comments suppressed due to low confidence (2)

src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunFileLayoutOptimizer.cs:321

  • [nitpick] Consider using a structured logging API instead of directly writing to logger.Writer, to ensure consistent logging behavior and easier log management.
_logger.Writer.WriteLine("Warning: no call graph data was found or a .mibc file was not specified. Skipping Pettis Hansen method ordering.");

src/coreclr/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs:152

  • The removal of the partial method ApplyCustomSort in favor of directly comparing the CustomSort field appears consistent; please ensure that no scenarios relying on the legacy partial method behavior (especially under conditional compilation) are affected.
static partial void ApplyCustomSort(SortableDependencyNode x, SortableDependencyNode y, ref int result);

@dotnet-policy-service
Copy link
Contributor

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

binaries are up to date and which are stale. -->
<GenerateDependencyFile>false</GenerateDependencyFile>
<Configurations>Debug;Release;Checked</Configurations>
<RunAnalyzers>false</RunAnalyzers>
Copy link
Member

@jkotas jkotas Apr 16, 2025

Choose a reason for hiding this comment

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

Intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Matches ILCompiler.ReadyToRun, there are several low value warnings and I'm honestly growing tired of the analyzers and pragma warning suppresions we're accumulating as a result and decided to just take a page from the crossgen project.

new("--optimize-time", "--Ot") { Description = "Enable optimizations, favor code speed" };
public Option<string[]> MibcFilePaths { get; } =
new("--mibc", "-m") { DefaultValueFactory = _ => Array.Empty<string>(), Description = "Mibc file(s) for profile guided optimization" };
public Option<ReadyToRunMethodLayoutAlgorithm> MethodLayout { get; } =
Copy link
Member

Choose a reason for hiding this comment

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

Do these options have the right default? Or is that a future item?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a copypaste from crossgen - this should default to 0, which means don't do it.

<Compile Include="..\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\CallGraphNode.cs" Link="Compiler\PettisHansenSort\CallGraphNode.cs" />
<Compile Include="..\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\DisjointSetForest.cs" Link="Compiler\PettisHansenSort\DisjointSetForest.cs" />
<Compile Include="..\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\PettisHansen.cs" Link="Compiler\PettisHansenSort\PettisHansen.cs" />
<Compile Include="..\ILCompiler.ReadyToRun\Compiler\ReadyToRunFileLayoutOptimizer.cs" Link="Compiler\ReadyToRunFileLayoutOptimizer.cs" />
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to drop ReadyToRun prefix for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, just wanted to keep the diff small

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM as intermediate step.

@MichalStrehovsky MichalStrehovsky merged commit 29acb2f into dotnet:main Apr 30, 2025
92 of 94 checks passed
@MichalStrehovsky MichalStrehovsky deleted the layout branch April 30, 2025 10:54
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 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.

Native AOT: Re-order method bodies using PGO data

2 participants