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

Check that 'lvDoNotEnregister' is set as necessary. #52802

Merged
merged 2 commits into from
May 27, 2021

Conversation

sandreenko
Copy link
Contributor

@sandreenko sandreenko commented May 15, 2021

In order to enable #43867 by default we need to make sure that all structs that should be on the stack are marked as doNotEnreg. Currently, it is not very important because all structs are getting their 'doNotEnreg' just because they are structs.

This PR adds check that after lowering we have correct lvDoNotEnreg flag on variables that are accessed via their address or via non-promoted fields or with both promoted and non-promoted accesses.

If you see more contracts related to doNotEnreg that can be added - please comment. There are also many unclear parts about multi-reg nodes that I am going to address soon.

No diffs (all available spmi collections) as expected.

Fixes #49780 (change in rationalize RewriteSIMDIndir).

Contributes to #43867, needed #53269 (phi store of long vars were not decomposed so the contract for them did not hold), #53067, #52803.

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 15, 2021
@sandreenko sandreenko marked this pull request as draft May 19, 2021 06:24
@sandreenko sandreenko force-pushed the GitHub_49780_prep branch 3 times, most recently from 378b981 to 1a62d7d Compare May 21, 2021 07:38
Sergey added 2 commits May 26, 2021 20:46
Check that we don't have independently promoted LCL_VAR that are references after lowering.
Check that all LclVars that have ADDR() on top of them are marked as doNotEnreg.

In the past when we did not enregister structs we were allocating them on the stack even without doNotEnreg set.
@sandreenko
Copy link
Contributor Author

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sandreenko sandreenko marked this pull request as ready for review May 27, 2021 05:48
@sandreenko sandreenko changed the title LclVar which addresses are taken should be marked as doNotEnreg. Check that 'lvDoNotEnregister' is set as necessary. May 27, 2021
@sandreenko
Copy link
Contributor Author

I think this is ready for review, PTAL @dotnet/jit-contrib

@AndyAyersMS
Copy link
Member

You can ignore the pgo failures, sorry about that.

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.

Perhaps consider adding a debug-only field that tracks the union of all the DNER settings for a local var, and adjust the dump info to show all reasons?

@sandreenko
Copy link
Contributor Author

Perhaps consider adding a debug-only field that tracks the union of all the DNER settings for a local var, and adjust the dump info to show all reasons?

Sound valuable, will add in one of the next changes.

@sandreenko sandreenko merged commit edaa6d7 into dotnet:main May 27, 2021
@sandreenko sandreenko deleted the GitHub_49780_prep branch May 31, 2021 08:25
@ghost ghost locked as resolved and limited conversation to collaborators Jun 30, 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.

Assertion failed '!foundDiff' when an HFA local var is passed on stack
2 participants