Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
enable for x86.
  • Loading branch information
Sergey committed Jul 12, 2021
commit c6f2bf57aac7857c82daebd93b5379456fe976e2
1 change: 1 addition & 0 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -6801,6 +6801,7 @@ struct GenTreeCopyOrReload : public GenTreeUnOp

GenTreeCopyOrReload(genTreeOps oper, var_types type, GenTree* op1) : GenTreeUnOp(oper, type, op1)
{
assert(type != TYP_STRUCT || op1->IsMultiRegNode());
SetRegNum(REG_NA);
ClearOtherRegs();
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/jitconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ CONFIG_INTEGER(JitSaveFpLrWithCalleeSavedRegisters, W("JitSaveFpLrWithCalleeSave
#endif // defined(TARGET_ARM64)
#endif // DEBUG

#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
#if defined(TARGET_WINDOWS) && defined(TARGET_XARCH)
CONFIG_INTEGER(JitEnregStructLocals, W("JitEnregStructLocals"), 1) // Allow to enregister locals with struct type.
#else
CONFIG_INTEGER(JitEnregStructLocals, W("JitEnregStructLocals"), 0) // Don't allow to enregister locals with struct type
Expand Down
17 changes: 14 additions & 3 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6180,10 +6180,21 @@ void LinearScan::insertCopyOrReload(BasicBlock* block, GenTree* tree, unsigned m
}
else
{
// Create the new node, with "tree" as its only child.
var_types treeType = tree->TypeGet();
var_types regType = tree->TypeGet();
if ((regType == TYP_STRUCT) && !tree->IsMultiRegNode())
{
assert(compiler->compEnregStructLocals());
assert(tree->IsLocal());
const GenTreeLclVarCommon* lcl = tree->AsLclVarCommon();
const LclVarDsc* varDsc = compiler->lvaGetDesc(lcl);
// We create struct copies with a primitive type so we don't bother copy node with parsing structHndl.
// Note that for multiReg node we keep each regType in the tree and don't need this.
regType = varDsc->GetRegisterType(lcl);
assert(regType != TYP_UNDEF);
}

GenTreeCopyOrReload* newNode = new (compiler, oper) GenTreeCopyOrReload(oper, treeType, tree);
// Create the new node, with "tree" as its only child.
GenTreeCopyOrReload* newNode = new (compiler, oper) GenTreeCopyOrReload(oper, regType, tree);
assert(refPosition->registerAssignment != RBM_NONE);
SetLsraAdded(newNode);
newNode->SetRegNumByIdx(refPosition->assignedReg(), multiRegIdx);
Expand Down