Skip to content

Remove phi nodes during rationalize. #53269

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

Merged
merged 3 commits into from
May 27, 2021

Conversation

sandreenko
Copy link
Contributor

@sandreenko sandreenko commented May 26, 2021

Get rid of PHI/PHI_ARG nodes during rationalize phase, these nodes are not used after optimization phases.

This change allows us to

  1. save some compilation time (trying to measure now, problems with PIN tool)
  2. simplify the code;
  3. solve my issue with LONG phi store on x86/arm that are not decomposed;

I did not expect any diffs but I have one on x86 windows libraries tests (out of all spmi collections that we have)

Top method improvements (bytes):
         -21 (-2.31% of base) : 282396.dasm - System.DirectoryServices.Tests.DirectoryServicesTests:TestInvalidUserAndPassword():this

it looks like LSRA noise but I am analyzing it now.

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 26, 2021
@sandreenko
Copy link
Contributor Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sandreenko sandreenko marked this pull request as ready for review May 26, 2021 20:42
@sandreenko
Copy link
Contributor Author

PTAL @AndyAyersMS @BruceForstall @dotnet/jit-contrib

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.

LGTM too. Thanks for doing this Sergey.

@sandreenko
Copy link
Contributor Author

pin shows 0.1-0.2% jit compilation time improvement (x64 spmi replay on release without pgo), sounds like what I expected.

@sandreenko
Copy link
Contributor Author

finally found the reason for the diff, when we create RefTypeZeroInit we use the name of the first node in the list, before the change it was PHI_ARG now it is IL_OFFSET, it happens here:

GenTree* firstNode = getNonEmptyBlock(compiler->fgFirstBB)->firstNode();

then, when we assign weights we check if (isCandidateLocalRef(treeNode)) and in the base line it was true, now it is false:

if (isCandidateLocalRef(treeNode))

so not a "real" diff, just not the best mechanism for these zero-inits.

@sandreenko sandreenko merged commit 3270344 into dotnet:main May 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2021
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.

3 participants