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

Fix 'varDsc->lvExactSize == 12' assert. #38484

Merged
merged 4 commits into from
Jul 1, 2020

Conversation

sandreenko
Copy link
Contributor

@sandreenko sandreenko commented Jun 27, 2020

It is a small pessimization, but no diffs(benchmarks/libraries),

I had a more ambitious change (based on Tanner's suggestion and ClassLayout added to JitIntrinsic by Carol recently) that required layout for each Intrinsic (SIMD and HW) node to be initialized and it was passing tests. However:

  • I feel like it was too dangerous for the current moment in the release cycle;
  • would require more time to prepare for review;
  • the most important, we have an issue with LCL_FLD for structs with overlapping fields when we drop FldSeq and can't restore CLASS_HANDLE after, so it was not clear for me how to keep struct handle in this case.

Fixes #36586.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 27, 2020
@sandreenko sandreenko changed the title Test Fix 'varDsc->lvExactSize == 12' assert. Jun 30, 2020
@sandreenko sandreenko marked this pull request as ready for review June 30, 2020 10:54
@sandreenko
Copy link
Contributor Author

PTAL @briansull @CarolEidt @tannergooding @dotnet/jit-contrib

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 - thanks!

{
m_pCompiler->lvaGetDesc(cseLclVarNum)->lvSIMDType = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still set lvSIMDType to true for the new CSE SIMD LclVars?
Is it done by lvaSetStruct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,lvaSetStruct handles it:

if (simdBaseType != TYP_UNKNOWN)
{
assert(varTypeIsSIMD(varDsc));
varDsc->lvSIMDType = true;
varDsc->lvBaseType = simdBaseType;

@@ -3216,7 +3214,7 @@ bool Compiler::optIsCSEcandidate(GenTree* tree)

// If this is a struct type, we can only consider it for CSE-ing if we can get at
// its handle, so that we can create a temp.
Copy link
Contributor

Choose a reason for hiding this comment

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

// If this is a struct type (or SIMD type),

@sandreenko sandreenko merged commit 2d0249e into dotnet:master Jul 1, 2020
@sandreenko sandreenko deleted the fixSIMD12Assert branch July 1, 2020 05:25
@tannergooding
Copy link
Member

👍

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
@sandreenko sandreenko restored the fixSIMD12Assert branch September 2, 2021 05:03
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 'varDsc->lvExactSize == 12'
5 participants