@@ -10205,9 +10205,10 @@ void Compiler::gtDispRegVal(GenTree* tree)
10205
10205
break;
10206
10206
}
10207
10207
10208
+ #if FEATURE_MULTIREG_RET
10208
10209
if (tree->IsMultiRegCall())
10209
10210
{
10210
- // 0th reg is GettRegNum (), which is already printed above.
10211
+ // 0th reg is GetRegNum (), which is already printed above.
10211
10212
// Print the remaining regs of a multi-reg call node.
10212
10213
const GenTreeCall* call = tree->AsCall();
10213
10214
const unsigned regCount = call->GetReturnTypeDesc()->TryGetReturnRegCount();
@@ -10216,28 +10217,37 @@ void Compiler::gtDispRegVal(GenTree* tree)
10216
10217
printf(",%s", compRegVarName(call->GetRegNumByIdx(i)));
10217
10218
}
10218
10219
}
10219
- else if (tree->IsCopyOrReloadOfMultiRegCall ())
10220
+ else if (tree->IsCopyOrReload ())
10220
10221
{
10222
+ GenTree* op1 = tree->gtGetOp1();
10221
10223
const GenTreeCopyOrReload* copyOrReload = tree->AsCopyOrReload();
10222
- const GenTreeCall* call = tree->gtGetOp1()->AsCall();
10223
- const unsigned regCount = call->GetReturnTypeDesc()->TryGetReturnRegCount();
10224
- for (unsigned i = 1; i < regCount; ++i)
10224
+ unsigned regCount = 0;
10225
+ if (op1->OperIs(GT_CALL))
10225
10226
{
10226
- printf(",%s", compRegVarName(copyOrReload->GetRegNumByIdx(i)));
10227
- }
10228
- }
10229
-
10230
- #if FEATURE_MULTIREG_RET
10231
- if (tree->IsCopyOrReload())
10232
- {
10233
- for (int i = 1; i < MAX_RET_REG_COUNT; i++)
10234
- {
10235
- regNumber reg = (regNumber)tree->AsCopyOrReload()->GetRegNumByIdx(i);
10236
- if (reg == REG_NA)
10227
+ if (op1->IsMultiRegCall())
10237
10228
{
10238
- break;
10229
+ regCount = op1->AsCall()->GetReturnTypeDesc()->TryGetReturnRegCount();
10230
+ // If it hasn't yet been initialized, we'd still like to see the registers printed.
10231
+ if (regCount == 0)
10232
+ {
10233
+ regCount = MAX_RET_REG_COUNT;
10234
+ }
10239
10235
}
10240
- printf(",%s", compRegVarName(reg));
10236
+ }
10237
+ else if (op1->IsMultiRegLclVar())
10238
+ {
10239
+ regCount = op1->AsLclVar()->GetFieldCount(this);
10240
+ }
10241
+ else if (op1->IsMultiRegNode())
10242
+ {
10243
+ regCount = op1->GetMultiRegCount();
10244
+ }
10245
+ // We will only have valid regs for positions that require copy or reload.
10246
+ // But we'd like to keep track of where they are so we print all positions.
10247
+ for (unsigned i = 1; i < regCount; i++)
10248
+ {
10249
+ regNumber reg = tree->AsCopyOrReload()->GetRegNumByIdx(i);
10250
+ printf(",%s", (reg == REG_NA) ? ",NA" : compRegVarName(reg));
10241
10251
}
10242
10252
}
10243
10253
#endif
0 commit comments