Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3998,9 +3998,7 @@ class Compiler
void gtDispLeaf(GenTree* tree, IndentStack* indentStack);
void gtDispLocal(GenTreeLclVarCommon* tree, IndentStack* indentStack);
void gtDispNodeName(GenTree* tree);
#if FEATURE_MULTIREG_RET
unsigned gtDispMultiRegCount(GenTree* tree);
#endif
void gtDispRegVal(GenTree* tree);
void gtDispVN(GenTree* tree);
void gtDispCommonEndLine(GenTree* tree);
Expand Down
48 changes: 23 additions & 25 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,44 +857,46 @@ bool GenTree::gtHasReg(Compiler* comp) const
int GenTree::GetRegisterDstCount(Compiler* compiler) const
{
assert(!isContained());
if (!IsMultiRegNode())
{
return IsValue() ? 1 : 0;
}
else if (IsMultiRegCall())

#if FEATURE_MULTIREG_RET
if (IsMultiRegCall())
{
return AsCall()->GetReturnTypeDesc()->GetReturnRegCount();
}
else if (IsCopyOrReload())
{
return gtGetOp1()->GetRegisterDstCount(compiler);
}

#if !defined(TARGET_64BIT)
else if (OperIsMultiRegOp())
if (OperIsMultiRegOp())
{
assert(OperIs(GT_MUL_LONG));
return 2;
}
#endif
#ifdef FEATURE_HW_INTRINSICS
else if (OperIsHWIntrinsic())
#endif // FEATURE_MULTIREG_RET

if (IsCopyOrReload())
{
assert(TypeIs(TYP_STRUCT));
return gtGetOp1()->GetRegisterDstCount(compiler);
}

const GenTreeHWIntrinsic* intrinsic = AsHWIntrinsic();
const NamedIntrinsic intrinsicId = intrinsic->GetHWIntrinsicId();
assert(HWIntrinsicInfo::IsMultiReg(intrinsicId));
#ifdef FEATURE_HW_INTRINSICS
if (OperIsHWIntrinsic())
{
const NamedIntrinsic intrinsicId = AsHWIntrinsic()->GetHWIntrinsicId();

return HWIntrinsicInfo::GetMultiRegCount(intrinsicId);
if (HWIntrinsicInfo::IsMultiReg(intrinsicId))
{
return HWIntrinsicInfo::GetMultiRegCount(intrinsicId);
}
Comment thread
tannergooding marked this conversation as resolved.
}
#endif // FEATURE_HW_INTRINSICS

if (OperIsScalarLocal())
if (IsMultiRegLclVar())
{
return AsLclVar()->GetFieldCount(compiler);
}
assert(!"Unexpected multi-reg node");
return 0;

assert(!IsMultiRegNode());
return IsValue() ? 1 : 0;
Comment thread
tannergooding marked this conversation as resolved.
}

//-----------------------------------------------------------------------------------
Expand Down Expand Up @@ -927,7 +929,7 @@ bool GenTree::IsMultiRegNode() const
#endif
#endif // FEATURE_MULTIREG_RET

if (OperIs(GT_COPY, GT_RELOAD))
if (IsCopyOrReload())
{
return true;
}
Expand Down Expand Up @@ -13004,7 +13006,6 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, _In_ _In_opt_
}
}

#if FEATURE_MULTIREG_RET
//----------------------------------------------------------------------------------
// gtDispMultiRegCount: determine how many registers to print for a multi-reg node
//
Expand Down Expand Up @@ -13050,7 +13051,6 @@ unsigned Compiler::gtDispMultiRegCount(GenTree* tree)
return tree->GetMultiRegCount(this);
}
}
#endif // FEATURE_MULTIREG_RET

//----------------------------------------------------------------------------------
// gtDispRegVal: Print the register(s) defined by the given node
Expand All @@ -13073,7 +13073,6 @@ void Compiler::gtDispRegVal(GenTree* tree)
return;
}

#if FEATURE_MULTIREG_RET
if (tree->IsMultiRegNode())
{
// 0th reg is GetRegNum(), which is already printed above.
Expand All @@ -13087,7 +13086,6 @@ void Compiler::gtDispRegVal(GenTree* tree)
printf(",%s", genIsValidReg(reg) ? compRegVarName(reg) : "NA");
}
}
#endif
}

// We usually/commonly don't expect to print anything longer than this string,
Expand Down
Loading