dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.15k stars 4.71k forks source link

JIT: Productize JitOptRepeat #108902

Open BruceForstall opened 5 days ago

BruceForstall commented 5 days ago

JitOptRepeat is a JIT configuration that repeats certain optimization phases two or more times to generate better code. Repeated optimization phases can lead to better code because the design of existing individual phases leads to a specific phase ordering: for any two distinct phases A and B, one must be run before the other. But running A before B might lead to missed optimization opportunities, just as running B before A. Repeating some phases can mitigate the phase ordering problems.

The JitOptRepeat configuration has been in the JIT for many years. In .NET 9, many correctness bugs with it were fixed; it was made available in Release builds; a performance benchmark test with JitOptRepeat enabled was created; and it was added to JIT stress modes and to the JIT "experimental" AzDO pipeline, to prevent JitOptRepeat correctness regressions. For example, see https://github.com/dotnet/runtime/pull/100494 and related.

For .NET 10, the goal is to see if we can productize the use of JitOptRepeat in some form to generate better code.

Work items:

dotnet-policy-service[bot] commented 5 days ago

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