Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JIT: Late expansion for casts#97075

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
EgorBo merged 17 commits intodotnet:mainfromEgorBo:late-cast-expansion
Jan 19, 2024
Merged

Conversation

@EgorBo
Copy link
Member

Move cast expansion from importer to a late phase. For now, only for profiled isinst.

Closes#96837
Contributes to#84025

@ghostghost added the area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labelJan 17, 2024
@ghostghost assignedEgorBoJan 17, 2024
@ghost
Copy link

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

Issue Details

Move cast expansion from importer to a late phase. For now, only for profiled isinst.

Closes#96837
Contributes to#84025

Author:EgorBo
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@EgorBo
Copy link
MemberAuthor

/azp run runtime-coreclr pgo, runtime-coreclr libraries-pgo, runtime-coreclr pgostress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@EgorBoEgorBo marked this pull request as ready for reviewJanuary 18, 2024 04:21
@EgorBo
Copy link
MemberAuthor

EgorBo commentedJan 18, 2024
edited
Loading

@jakobbotsch @dotnet/jit-contrib PTAL.Diffs. There are few things in the diffs:

  1. Improvements where we were able to hoist/CSE casts.

  2. Improvements where we realized block is cold and it doesn't need cast expansion, E.g.
    image
    (it was previously expanded)

  3. Regressions due to extra nullcheck this phase emits and no other phase can clean it up. But I already have a follow up patch to fix it via assertionprop

  4. Possible regressions because of CSE'd class handle argument - I wasn't able to find them but it may happen. This phase works as is if I move it after assertionprop so I can rely on VN to get it. Probably will do that separately.

Will move more casts to this phase from importer (all of them hopefully). For now only recently introduced profiled casts are handled.

Copy link
Member

@jakobbotschjakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM, but looks like CI is a bit unhappy.

EgorBo reacted with thumbs up emoji
@EgorBo
Copy link
MemberAuthor

/azp run runtime-coreclr pgo, runtime-coreclr libraries-pgo

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@EgorBo
Copy link
MemberAuthor

LGTM, but looks like CI is a bit unhappy.

Ah, I broke the control flow a bit - nullcheckBb used to jump straight to the use block without assigningtmp's value (but in most cases it was zeroed anyway so CImostly passed.

Instead, I now do:

Case 1:

tmp=obj;if (tmp!=null){if (tmp.pMT!=likelyClass)tmp=helperCallelseno-op;// this block will be collected}use(tmp);

Case 2 (likelyClass is known to never pass the type check):

tmp=obj;if (tmp!=null){if (tmp.pMT!=likelyClass)tmp=helperCallelsetmp=null;}use(tmp);

I can avoid the initialtmp = obj; by introducing an extra BB but I think this shape is simpler.

@EgorBo
Copy link
MemberAuthor

Failure is#97103

@EgorBoEgorBo merged commit26d8316 intodotnet:mainJan 19, 2024
@EgorBoEgorBo deleted the late-cast-expansion branchJanuary 19, 2024 20:59
tmds pushed a commit to tmds/runtime that referenced this pull requestJan 23, 2024
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 19, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@jakobbotschjakobbotschjakobbotsch approved these changes

Assignees

@EgorBoEgorBo

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Profiled casts: isinst is no longer hoisted

2 participants

@EgorBo@jakobbotsch

[8]ページ先頭

©2009-2025 Movatter.jp