Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
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
15 changes: 13 additions & 2 deletions src/jit/gschecks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void Compiler::gsParamsToShadows()
}

if (!varDsc->lvIsPtr && !varDsc->lvIsUnsafeBuffer)
{
{
continue;
}

Expand All @@ -414,7 +414,18 @@ void Compiler::gsParamsToShadows()
// Copy some info

var_types type = varTypeIsSmall(varDsc->TypeGet()) ? TYP_INT : varDsc->TypeGet();
lvaTable[shadowVar].lvType = type;
lvaTable[shadowVar].lvType = type;

Choose a reason for hiding this comment

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

Would it make sense to have a copy method for LclVarDsc?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure that i understood the suggestion. Are you implying to abstract the logic that copies varDsc fields to shadow param into a separate routine? I don't think that would be valuable, because other than gscheck logic no other place has such a need.

VarDsc has many fields but gsParamsToShadow() is selectively copying few of the fields when it creates a shadow lcl var. Are you implying to copy all fields? That would need carefully examining whether it makes sense to verbatim copy and is beyond the scope of this fix.


#ifdef FEATURE_SIMD
lvaTable[shadowVar].lvSIMDType = varDsc->lvSIMDType;
lvaTable[shadowVar].lvUsedInSIMDIntrinsic = varDsc->lvUsedInSIMDIntrinsic;
if (varDsc->lvSIMDType)
{
lvaTable[shadowVar].lvBaseType = varDsc->lvBaseType;
}
#endif
lvaTable[shadowVar].lvRegStruct = varDsc->lvRegStruct;

lvaTable[shadowVar].lvAddrExposed = varDsc->lvAddrExposed;
lvaTable[shadowVar].lvDoNotEnregister = varDsc->lvDoNotEnregister;
#ifdef DEBUG
Expand Down