-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Crossgen2 shouldn't compile inlineable internal methods #54781
Comments
Crossgen2 by default goes over everything in the assembly and adds it as a compilation root here: runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs Lines 96 to 128 in 969840e
I think if we were to scope this list of roots down to public/protected/virtual members, and whatever is specified as the assembly entrypoint, we would achieve what we need. Other methods that are called from the rooted methods should be simply added to the compilation graph as the compiler makes transitive progress. Methods that got inlined will be simply ignored. We might be able to do the same thing on all methods of non-public types. We could treat assemblies with Cc @dotnet/crossgen-contrib |
@EgorBo, if you put together such a change please also make private methods which implement interfaces explicitly be considered part of the surface area to precompile. (Also, in addition to this bit of code we have some logic that triggers some compilation of generics which will also need tweaking. |
From my understanding, I was assigned to triage it :) but I can try if nobody else from the runtime side will pick it up, thanks for the initial pointers to look at! |
Well, my comments here really refer to whoever fixes it. Let us know about the triage decision. Its possible we could do this as part of the crossgen2 work. |
I think this would be covered by the "virtual members" part of my description. It's easier to check for. |
Moving to 7.0.0 as it unlikely to make into 6.0.0 |
Going to remove |
If an internal method is inlined at all callsites where it's called - we shouldn't prejit it. It was noticed in #52708 (comment) (cc @jkotas)
Repro:
Create a console library with a single class:
And prejit it using Checked version of runtime:
Actual output:
Expected output:
The text was updated successfully, but these errors were encountered: