-
Notifications
You must be signed in to change notification settings - Fork 128
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
ILLink is leaving in callsite to constant method #1113
Comments
The linker is not IL optimizer/rewriter, we tried to not to go there unless really necessary. We might consider that in the future but no noticeable saving scenario showed up based on this yet. |
Similar example of the same from dotnet/runtime#41097 where we branch like this:
we endup with this IL after linking:
All the get methods return false. It would be nice to avoid calling them and removing the |
Linker now inlines some of the const methods. For example the SR.GetResourceString now looks like this:
It's still not perfect (there's no need for ldc.i4.1, pop) but the call is removed and JIT will probably optimize this fully. |
In the
dotnet/runtime
libraries, we have the following code in System.SR:When this is passed through the linker, the IL is re-written to remove the branch around the constant
UsingResourceKeys()
, but the linker is leaving the call site toUsingResourceKeys()
inGetResourceString()
.We should be removing the call to
UsingResourceKeys()
as well, since it is not used.The text was updated successfully, but these errors were encountered: