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

JIT: impDevirtualizeCall might discard commas #67982

Open
jakobbotsch opened this issue Apr 13, 2022 · 3 comments
Open

JIT: impDevirtualizeCall might discard commas #67982

jakobbotsch opened this issue Apr 13, 2022 · 3 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@jakobbotsch
Copy link
Member

jakobbotsch commented Apr 13, 2022

impDevirtualizeCall uses gtEffectiveVal when accessing 'this', indicating that we may see commas here:

GenTree* thisObj = call->gtCallThisArg->GetNode()->gtEffectiveVal(false);

Later in the function we do an optimization for boxes where we replace 'this' without taking commas into account:
call->gtCallThisArg = gtNewCallArgs(localCopyThis);

call->gtCallThisArg = gtNewCallArgs(localCopyThis);

#67238 adds an assert that we didn't actually have a comma here, but this might not be right.

category:correctness
theme:devirtualization
skill-level:beginner
cost:small
impact:small

@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Apr 13, 2022
@ghost
Copy link

ghost commented Apr 13, 2022

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

impDevirtualizeCall uses gtEffectiveVal when accessing 'this', indicating that we may see commas here:

GenTree* thisObj = call->gtCallThisArg->GetNode()->gtEffectiveVal(false);

Later in the function we do an optimization for boxes where we replace 'this' without taking commas into account:
call->gtCallThisArg = gtNewCallArgs(localCopyThis);

call->gtCallThisArg = gtNewCallArgs(localCopyThis);

#67238 adds an assert that we didn't actually have a comma here, but this might not be right.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr, untriaged

Milestone: -

@AndyAyersMS AndyAyersMS self-assigned this Apr 15, 2022
@AndyAyersMS AndyAyersMS removed the untriaged New issue has not been triaged by the area owner label Apr 15, 2022
@AndyAyersMS AndyAyersMS added this to the 7.0.0 milestone Apr 15, 2022
@AndyAyersMS
Copy link
Member

Tried coming up with a case where we'd have a GT_BOX in a comma but couldn't find one. The importer doesn't create that many commas, and the ones it creates are for stylized patterns. Not saying it can never happen.

A more likely possibility is that we run into one of these during late devirtualization, after more phases have run.

@AndyAyersMS
Copy link
Member

I haven't been able to create a case where this happens, so will move this out of 7.0.

@AndyAyersMS AndyAyersMS modified the milestones: 7.0.0, Future Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

2 participants