Skip to content

Copy propagation tweaking - #64378

Merged
AndyAyersMS merged 4 commits into
dotnet:mainfrom
SingleAccretion:Copy-Propagation-Checks
Feb 10, 2022
Merged

Copy propagation tweaking#64378
AndyAyersMS merged 4 commits into
dotnet:mainfrom
SingleAccretion:Copy-Propagation-Checks

Conversation

@SingleAccretion

@SingleAccretionSingleAccretion commented Jan 27, 2022

Copy link
Copy Markdown
Contributor

Some small CQ improvements in preparation for a zero-diff TP-oriented refactoring.

Please refer to the individual commit messages for details.

Diffs.

@ghostghost added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member labels Jan 27, 2022
@ghost

Copy link
Copy Markdown

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

Issue Details

Some small CQ improvements in preparation for a zero-diff TP-oriented refactoring.

Author:SingleAccretion
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@SingleAccretion
SingleAccretion marked this pull request as ready for review January 27, 2022 15:51
@SingleAccretion

Copy link
Copy Markdown
ContributorAuthor

@dotnet/jit-contrib

@TIHanTIHan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

The type check is too conservative: it prevents partial
definitions from being used in propagation:
```
LCL_FLD V00/1 [X] = { ... }; // Pushed on the stack as a def.
USE LCL_VAR V01 // Has the same VN as V00/1, but the type
// check prevented it from being replaced.
```
This new version is conservative too, but will do for now
as we don't propagate on (most) partial uses.
Another reason for this change is that in my upcoming refactoring
of copy propagation (that will bring another 0.5% in TP gains), we
will no longer have the "defNode" available.
Ordinarily, shadowed parameters would not be used for
propagation anyway, because of the liveness check, but
"this" bypasses that checks, and so was used, which is
presumably not what we want.
Regardless of that, it is also not profitable to propagate
"this" in such a situation as it extends its live range
and makes the RA unhappy.
Comment threadsrc/coreclr/jit/compiler.h Outdated
public:
struct ShadowParamVarInfo
{
static const unsigned NO_SHADOW_COPY = UINT_MAX;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: why not just use BAD_VAR_NUM?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I suppose no reason. Deleted it.

@AndyAyersMSAndyAyersMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks again for your ongoing contributions.

@AndyAyersMS
AndyAyersMS merged commit 161f13d into dotnet:mainFeb 10, 2022
@SingleAccretion
SingleAccretion deleted the Copy-Propagation-Checks branch February 10, 2022 21:08
@ghostghost locked as resolved and limited conversation to collaborators Mar 13, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@SingleAccretion@TIHan@AndyAyersMS@JulieLeeMSFT