Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Have SIMDIntrinsicUpperSave and SIMDIntrinsicUpperRestore set a baseType if one can't otherwise be determined #35899

Merged
merged 1 commit into from
May 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/coreclr/src/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6755,6 +6755,17 @@ void LinearScan::insertUpperVectorSave(GenTree* tree,
GenTreeSIMD* simdNode =
new (compiler, GT_SIMD) GenTreeSIMD(LargeVectorSaveType, saveLcl, nullptr, SIMDIntrinsicUpperSave,
varDsc->lvBaseType, genTypeSize(varDsc->lvType));

if (simdNode->gtSIMDBaseType == TYP_UNDEF)
{
// There are a few scenarios where we can get a LCL_VAR which
// doesn't know the underlying baseType. In that scenario, we
// will just lie and say it is a float. Codegen doesn't actually
// care what the type is but this avoids an assert that would
// otherwise be fired from the more general checks that happen.
simdNode->gtSIMDBaseType = TYP_FLOAT;
}

SetLsraAdded(simdNode);
simdNode->SetRegNum(spillReg);
if (spillToMem)
Expand Down Expand Up @@ -6812,6 +6823,16 @@ void LinearScan::insertUpperVectorRestore(GenTree* tree,
new (compiler, GT_SIMD) GenTreeSIMD(varDsc->lvType, restoreLcl, nullptr, SIMDIntrinsicUpperRestore,
varDsc->lvBaseType, genTypeSize(varDsc->lvType));

if (simdNode->gtSIMDBaseType == TYP_UNDEF)
{
// There are a few scenarios where we can get a LCL_VAR which
// doesn't know the underlying baseType. In that scenario, we
// will just lie and say it is a float. Codegen doesn't actually
// care what the type is but this avoids an assert that would
// otherwise be fired from the more general checks that happen.
simdNode->gtSIMDBaseType = TYP_FLOAT;
}

regNumber restoreReg = upperVectorInterval->physReg;
SetLsraAdded(simdNode);

Expand Down