-
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
JIT: don't optimize calls to CORINFO_HELP_VIRTUAL_FUNC_PTR for interface class lookups #82209
Conversation
The jit currently replaces calls to `CORINFO_HELP_VIRTUAL_FUNC_PTR` whose results are unused with null pointer checks. But this helper can now throw a variety of exceptions, so this optimization is incorrect. Fixes dotnet#82127.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThe jit currently replaces calls to But this helper can now throw a variety of exceptions, so this optimization is incorrect. Fixes #82127.
|
@BruceForstall PTAL I could not figure out when or why the helper call behavior changed, but per SPMI this optimization only kicks in for [edit: initially thought the diff I saw was from the |
I have added this optimization on 2004/08/31 ... memories :-) It was based on customer feedback: Some (3rd party?) compiler used |
Yes, if it is heavily used by some class of IL generators, we'll end up with helper calls instead of simple null checks, and perhaps miss downstream inferences that after this point the ref can't be null (that part I'd need to investigate further). It seems like the possibility of some other exception kinds being thrown by |
The interface method resolution can fail for number of different reasons. It has been the case since forever, we just did not notice. I think it should be still ok to do this optimization for non-interface methods. |
Odd
May be related, there are some diffs in arm64 linux crossgen2 to investigate. |
I don't see those diffs building locally. |
Going to update to latest main and retry. |
Testing hit a lot of infra issues. Going to cycle it. |
/azp run runtime-jit-experimental |
Azure Pipelines successfully started running 1 pipeline(s). |
Tizen armel: dotnet build tool installation crashed
|
This PR is jinxed. |
Failure to unzip build assets: |
The jit currently replaces calls to
CORINFO_HELP_VIRTUAL_FUNC_PTR
whose results are unused with null pointer checks.But if we're looking up a method on an interface, this helper can now throw a variety of exceptions, so this optimization is incorrect.
Fixes #82127.