Repository navigation
Optimize inline members of recursive groups on demand - #21017
Merged
Merged
Conversation
A member can use an inline member of the same recursive group through an inline function, for example `a * x` with `static member inline (*)`. The trait call that names the inline member appears only after the optimizer inlines FSharp.Core `(*)`. The predicted dependency order cannot find this dependency, so the optimizer reported FS1114. The optimizer now records the inline vals of the group elements that it did not optimize yet. When a lookup finds such a val, the optimizer optimizes its element immediately. Each element commits its effect on the optimization state in source order. This change removes the dependency-order scheduler. Fixes dotnet#21016
Contributor
Author
|
This is arguably simpler and better than #20111. Let's see if it passes. |
The test runner executes the compiled program in the test process, so exit stopped the test host. Use an entry point that fails on a wrong result.
majocha
marked this pull request as ready for review
November 23, 2026 14:16
abonie
approved these changes
Nov 23, 2026
This was referenced Nov 23, 2026
Member
|
/backport to release/11.0.1xx |
Contributor
|
Started backporting to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #21016
A member that uses an
inlinemember of its recursive group through an inline function, for examplea * xwithstatic member inline (*), failed with FS1114. The trait call that names the inline member appears only after the optimizer inlines FSharp.Core(*), so the dependency order from #20111 could not find it.The optimizer now optimizes a pending inline sibling at the first lookup of its val, and commits the effect of each element on the optimization state in source order. This replaces the predicted dependency order, so the optimizer again processes recursive groups in source order.
🤖 Generated with Claude Code