Skip to content
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

putting a bunch of opened issues about IL optimisation under IL baseline tests #16325

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

smoothdeveloper
Copy link
Contributor

@smoothdeveloper smoothdeveloper commented Nov 22, 2023

As discussed in #16302 (comment)

This is just to have the tests under CI check in case the code gen happens to change for any reason.

Note that I've put json metadata, we can discuss in this PR if we want to do something with it yet.

@smoothdeveloper smoothdeveloper requested a review from a team as a code owner November 22, 2023 11:11
@smoothdeveloper smoothdeveloper marked this pull request as draft November 24, 2023 22:29
@smoothdeveloper smoothdeveloper force-pushed the potential-optmimizations-under-il-baseline-checks branch from 95e29b8 to 95245fd Compare March 22, 2024 15:39
Copy link
Contributor

github-actions bot commented Mar 22, 2024

❗ Release notes required

@smoothdeveloper,

Caution

No release notes found for the changed paths (see table below).

Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format.

The following format is recommended for this repository:

* <Informative description>. ([PR #XXXXX](https://github.com/dotnet/fsharp/pull/XXXXX))

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

You can open this PR in browser to add release notes: open in github.dev

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.300.md No release notes found or release notes format is not correct

Comment on lines 1 to 13
// <testmetadata>
// { "optimization": { "reported_in": "#9548", "reported_by": "@teo-tsirpanis", "last_know_version_not_optimizing": "8", "first_known_version_optimizing": null } }
// </testmetadata>

open System

let g() =
for x in 0 .. 2 .. 15 do
Console.WriteLine x
g()
Copy link
Contributor

Choose a reason for hiding this comment

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

This one and for_loop_non_int should now both be optimized after #16650 (with langversion preview). (So I guess you'd update these once it got shipped in 9?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads up! I need to figure out the remaining baselines that fail on CI to hopefully wrap up this PR.

@smoothdeveloper smoothdeveloper force-pushed the potential-optmimizations-under-il-baseline-checks branch from 6edffb7 to 7a5b541 Compare March 24, 2024 12:59
@T-Gro
Copy link
Member

T-Gro commented Mar 26, 2024

The empty .err files can be removed.

@smoothdeveloper
Copy link
Contributor Author

There is something which currently makes IL baseline tests not robust among test runs and platform differences, related to static field.

$ use_binding_on_struct_enumerator.fsx.il.net472.release.bsl
diff at line 92:
expected:
.field static assembly valuetype '<PrivateImplementationDetails$assembly>'/T3534_24Bytes@ field3535@ at I_00003945
actual:
.field static assembly valuetype '<PrivateImplementationDetails$assembly>'/T3534_24Bytes@ field3535@ at I_00003908

I've circumvented one aspect of it, the field name, by exposing a new FSharp.Compiler.CompilerGlobalState.resetUniqueAndStamp() function, but the remaining aspect seems to be the at I_xyz aspect (I guess it is the offset in the assembly), I'm not sure what to do about it.

@KevinRansom, wondering if you have any suggestion about either mainge the assembly generation consistent so the disassembly wouldn't be affected, or another thing we could do in context of the tests, to make those IL baseline tests more robust?

I think we want IL baseline test to be suitable for more aspects than currently exercised in the test suite, to cover more ground in terms of non-regression and awareness of code generation changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants