else if (unspillTree->OperIsMultiRegOp())
{
GenTreeMultiRegOp* multiReg = unspillTree->AsMultiRegOp();
- unsigned regCount = multiReg->gtOtherReg == REG_NA ? 1 : 2;
+ unsigned regCount = multiReg->GetRegCount();
// In case of split struct argument node, GTF_SPILLED flag on it indicates that
// one or more of its result regs are spilled. Call node needs to be
else if (tree->OperIsMultiRegOp())
{
GenTreeMultiRegOp* multiReg = tree->AsMultiRegOp();
- unsigned regCount = multiReg->gtOtherReg == REG_NA ? 1 : 2;
+ unsigned regCount = multiReg->GetRegCount();
for (unsigned i = 0; i < regCount; ++i)
{
ClearOtherRegFlags();
}
+ unsigned GetRegCount() const
+ {
+ if (gtRegNum == REG_NA || gtRegNum == REG_STK)
+ {
+ return 0;
+ }
+ return (gtOtherReg == REG_NA || gtOtherReg == REG_STK) ? 1 : 2;
+ }
+
//---------------------------------------------------------------------------
// GetRegNumByIdx: get ith register allocated to this struct argument.
//