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

Delete GT_ASG #85871

Merged
merged 22 commits into from
May 24, 2023
Merged

Delete GT_ASG #85871

merged 22 commits into from
May 24, 2023

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented May 6, 2023

After many years of existing and some weeks of removal work, GT_ASG, the last large IR quirk, becomes no more, giving way to the store nodes in the entirety of the compiler.

Closes #10873.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label May 6, 2023
@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 May 6, 2023
@ghost
Copy link

ghost commented May 6, 2023

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

Issue Details

Measuring TP.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion
Copy link
Contributor Author

Full TP diff from before morph to after import:

image

image

@SingleAccretion
Copy link
Contributor Author

SingleAccretion commented May 16, 2023

Diffs:

  1. One regression in tests because a SIMD local does not get promoted due to the changed order of how structs are handled in the importer - cases with return buffers used to not go throw gtNewAssignNode, thus no "is used as a SIMD intrinsic" flag was set for them. Most of these cases were quirked away, but here it wasn't (because the call was wrapped in a RET_EXPR).
  2. A correctness fix in tests where GTF_IND_VOLATILE is now not lost for a struct store.

Of course, there is also a very nice TP diff.

@BruceForstall
Copy link
Member

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr outerloop, runtime-coreclr gcstress0x3-gcstress0xc

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@SingleAccretion
Copy link
Contributor Author

Stress results analysis:

  1. Stress: clean modulo known failures.
  2. Libraries stress: pre-existing op2.HasIconFlag() assertion failures, what looks like Test_EventSource_EtwManifestGeneration* tests failing in CI #48798 and a bunch of Quic connection timeouts on Linux ARM. The timeouts were not present in the first stress run, so seems unlikely they're related.
  3. GC stress: a number of timeouts, look to be pre-existing.

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.

I looked through everything and only have a few minor comment suggestions.

One broader nit is that we now use "value" and "data" somewhat interchangeably for what we used to sometimes call the RHS. I personally find "value" to be more semantically inspiring but don't feel like making a change here—assuming we decide we should—should hold up this PR.

Given the volume of the diffs it would be good to get a second reviewer. I would also like to hold off merging this until after the preview 5 snap tomorrow.

@jakobbotsch can you also do a review?

src/coreclr/jit/importer.cpp Outdated Show resolved Hide resolved
src/coreclr/jit/importer.cpp Outdated Show resolved Hide resolved
@@ -8813,8 +8829,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)

JITDUMP(" %08X", resolvedToken.token);

int aflags = isLoadAddress ? CORINFO_ACCESS_ADDRESS : CORINFO_ACCESS_GET;
GenTree* obj = nullptr;
GenTreeFlags indirFlags = impPrefixFlagsToIndirFlags(prefixFlags);
Copy link
Member

Choose a reason for hiding this comment

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

These aren't used until ~170 lines later, can we move this down closer to the use?

Copy link
Member

Choose a reason for hiding this comment

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

In the store case (below) there are quite a few more uses, so if you want to leave things this way for symmetry then perhaps mark it as const so it is clearer nothing in between is modifying it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The flags may get modified by the call impImportStaticFieldAddress, this happens when importing a static readonly object field. I can move both of these declarations closer to their uses if you think it would be better (the motivation for having this them this high up was indeed symmetry).

@SingleAccretion
Copy link
Contributor Author

One broader nit is that we now use "value" and "data" somewhat interchangeably for what we used to sometimes call the RHS. I personally find "value" to be more semantically inspiring.

Agree on that, there will be another "comment fixes" PR and I can fix datas then.

{
if (node->gtNext == nullptr)
if ((m_prevNode == node) || (node->gtNext == nullptr))
Copy link
Member

Choose a reason for hiding this comment

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

Is node->gtNext == nullptr a meaningful check if SequenceLocal no longer unconditionally clears it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to recheck, but it turns out the answer is yes. The scenario is when we have half-consistent state during local morph with m_stmtModified == true and a new (bashed to) local address node inserted into the tree. Arguably, we should not be sequencing locals once m_stmtModified becomes true, but that is pre-existing behavior.

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM also, great work!

@jakobbotsch jakobbotsch merged commit 18270a3 into dotnet:main May 24, 2023
@jakobbotsch
Copy link
Member

Thanks again! Awesome to have this in!

@BruceForstall
Copy link
Member

@SingleAccretion Thanks again for all your fantastic work improving the JIT!

@am11
Copy link
Member

am11 commented Jun 12, 2023

Is there an issue tracking #10873 (comment) (for the remainder of rationalizer phase)?

@SingleAccretion
Copy link
Contributor Author

SingleAccretion commented Jun 12, 2023

I don't think there is; moving rationalization upwards means LIRizing HIR, which I don't believe there are plans for at this point in time.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 13, 2023
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 community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove GT_ASG nodes
6 participants