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: Improve isinst expansion #99162

Merged
merged 1 commit into from
Mar 1, 2024
Merged

JIT: Improve isinst expansion #99162

merged 1 commit into from
Mar 1, 2024

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Mar 1, 2024

Small change - big (-400kb) diffs.

What it does, for op1 isinst ExactCls it changes the resulting shape like this:

      tmp = op1;
      if (tmp != null) // qmarkNull
      {
          if (tmp->pMT == ExactCls) // qmarkMT
              result = tmp;
          else
              result = null;
      }
      else
-        result = tmp; // tmp is always null here anyway
+        result = null;

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 1, 2024
@ghost ghost assigned EgorBo Mar 1, 2024
@ghost
Copy link

ghost commented Mar 1, 2024

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

Issue Details

Small change - big (-400kb) diffs.

What it does, for x isinst Cls it changes the resulting shape like this:

    //  tmp = op1;
    //  if (tmp != null) // qmarkNull
    //  {
    //      if (tmp->pMT == op2) // qmarkMT
    //          result = tmp;
    //      else
    //          result = null;
    //  }
    //  else
-    //     result = tmp;
+   //      result = null;
Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member Author

EgorBo commented Mar 1, 2024

@dotnet/jit-contrib PTAL, trivial change with nice diffs

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Nice find.

Where does this unblock things? I would have thought RBO would have already handled something like this. Maybe assignments get in the way?

@EgorBo
Copy link
Member Author

EgorBo commented Mar 1, 2024

Where does this unblock things? I would have thought RBO would have already handled something like this. Maybe assignments get in the way?

Assertion prop definitly handles this (lcl prop), but looks like it's better to do it early so it can help RBO. My guess that JitOptRepeat would solve this too 🙂

@EgorBo EgorBo merged commit 9100872 into dotnet:main Mar 1, 2024
125 of 127 checks passed
@EgorBo EgorBo deleted the cleanup-isinst branch March 1, 2024 18:48
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants