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

A few small jit changes. #31816

Merged
merged 4 commits into from
Feb 11, 2020
Merged

Conversation

sandreenko
Copy link
Contributor

Fix SPMI replay with COMPlus_JitDump, add a few new asserts, clean a few expressions.

No diffs x64 (SPC, spmi pri1 tests).

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 5, 2020
@@ -16858,6 +16858,9 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree)
case GT_OBJ:
structHnd = tree->AsObj()->GetLayout()->GetClassHandle();
break;
case GT_BLK:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use this path only in optIsCSEcandidate, but later optIsCSEcandidate doesn't know how to work with these opcodes, so it doesn't produce any diffs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, normally the layouts used by BLK do not have a class handle.

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 usually get such BLK nodes from OBJ nodes for structs that do not contain GC pointers.
I'll check if I see them in master.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I've managed to confuse myself. Yes, BLKs can have class handles now, it was my plan to have handles only in OBJs but it didn't happen.

@sandreenko
Copy link
Contributor Author

PTAL @dotnet/jit-contrib.
The main change is fix for SPMI replay, the others are just small preparations for the future PRs.

@sandreenko sandreenko marked this pull request as ready for review February 6, 2020 00:39
Copy link
Contributor

@CarolEidt CarolEidt left a comment

Choose a reason for hiding this comment

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

LGTM, though it will conflict with my #811

{
return 0;
}
assert(indirTree->TypeGet() != TYP_STRUCT); // Don't expect a struct type here.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be more clear to say why such an indir is not expected here - // struct typed indirs are expected to be contained or something like that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done, I will change that condition soon, so it will become clearer in the next PRs as well.

{
assert(ret->OperIs(GT_RETURN));

#if !defined(TARGET_64BIT)
if (ret->TypeGet() == TYP_LONG)
{
GenTree* op1 = ret->gtGetOp1();
GenTree* op1 = ret->gtOp1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems odd to go back to direct data member access. It was, is and will always be a bad programming practice for common data structures such as IR ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I forgot that gtGetOp1 is declared for GenTree, not for GenTreeOp). Will revert that.
Thank you.

@sandreenko
Copy link
Contributor Author

LGTM, though it will conflict with my #811

Thanks, I will wait until your PR is merged and then resolve the conflicts.

@sandreenko
Copy link
Contributor Author

The PR was rebased and updated.

@sandreenko sandreenko merged commit 71d2911 into dotnet:master Feb 11, 2020
@sandreenko sandreenko deleted the aFewSmallChanges branch February 24, 2020 20:02
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
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