-
Notifications
You must be signed in to change notification settings - Fork 847
Fix degradation of local names in Release code #11690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Very nice. I'm sorry for generating extra work for you though :). |
It's ok. I've wanted to see us do optimizations like this for a long time - they really do matter in F# code - but always held off. It's great to have them addressed I do need to be much more proactive about code reviewing however, I shouldn't have spotted that late. |
|
One baseline needed updating, it helps validate that we are indeed getting better names in release code |
|
Some of the changes (in tests) may be conflicting when #11687 is merged and vice versa. |
|
@kerams good point, you may make a "code generation & optimisation" meta issue, and update https://github.com/dotnet/fsharp/blob/main/.github/ISSUE_TEMPLATE/feature_request.md to point to it among the other ones. Some RFC also have pending potential latent optimisations that could be tracked as "for contributors" issues. |
This fixes the second problem in #11407 by making a general improvement to what happens when we eliminate user-define values in favour of compiler-generated values.
Note this builds on #11690 and when reviewing you can compare using https://github.com/dsyme/fsharp/compare/r2...dsyme:r3?expand=1
In release code when we have:
we use
ValValueinformation to eliminatesomeUserValuein favour ofsomeCompilerGeneratedThinggivingHowever the good user-facing name
someUserValuehas been thrown away and, for example,someCompilerGeneratedThingwill not appear in the debugger since it is, well, compiler generated.Instead when this elimination occurs we can forcibly adjust the name of
someCompilerGeneratedThingto besomeUserValueand mark it as not compiler generated. This is always valid, logically speaking (otherwise the ValValue information would not be valid) and will always improve the debugging experience for release code.This fixes the second problem in #11407 which introduced more compiler-generated bindings. It may also improve other cases where we generated compiler-generated bindings as part of optimization. Some baselines may need updating as a result (though most our baselines relevant to debugging are for debug code, not optimized code)