@@ -21584,38 +21584,32 @@ Compiler::fgWalkResult Compiler::fgUpdateInlineReturnExpressionPlaceHolder(
21584
21584
: NO_CLASS_HANDLE;
21585
21585
#endif // defined(FEATURE_HFA) || defined(FEATURE_UNIX_AMD64_STRUCT_PASSING)
21586
21586
21587
-
21588
21587
do
21589
21588
{
21590
21589
// Obtained the expanded inline candidate
21591
- GenTreePtr inlineCandidate;
21592
-
21593
- inlineCandidate = tree->gtRetExpr.gtInlineCandidate;
21590
+ GenTreePtr inlineCandidate = tree->gtRetExpr.gtInlineCandidate;
21594
21591
21595
- // If the inlineCandidate node is a leaf, we can just overwrite "tree" with it.
21596
- // But if it's not, we have to make sure to do a deep copy before overwriting it.
21597
- if (inlineCandidate->OperIsLeaf())
21592
+ #ifdef DEBUG
21593
+ if (comp->verbose)
21598
21594
{
21599
- tree->CopyFrom(inlineCandidate, comp);
21595
+ printf("\nReplacing the return expression placeholder ");
21596
+ printTreeID(tree);
21597
+ printf(" with ");
21598
+ printTreeID(inlineCandidate);
21599
+ printf("\n");
21600
+ // Dump out the old return expression placeholder it will be overwritten by the CopyFrom below
21601
+ comp->gtDispTree(tree);
21600
21602
}
21601
- else
21602
- {
21603
- tree->CopyFrom(comp->gtCloneExpr(inlineCandidate), comp);
21604
- #ifdef DEBUG
21605
- comp->CopyTestDataToCloneTree(inlineCandidate, tree);
21606
21603
#endif // DEBUG
21607
- }
21604
+
21605
+ tree->CopyFrom(inlineCandidate, comp);
21608
21606
21609
21607
#ifdef DEBUG
21610
- if (false && comp->verbose)
21608
+ if (comp->verbose)
21611
21609
{
21612
-
21613
- printf("\nAfter updating the return expression place holder ");
21614
- printTreeID(tree);
21615
- printf(" for call ");
21616
- printTreeID(inlineCandidate);
21617
- printf(":\n");
21610
+ printf("\nInserting the inline return expression\n");
21618
21611
comp->gtDispTree(tree);
21612
+ printf("\n");
21619
21613
}
21620
21614
#endif // DEBUG
21621
21615
}
@@ -21927,9 +21921,9 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call,
21927
21921
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21928
21922
void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo)
21929
21923
{
21930
- GenTreePtr iciCall = pInlineInfo->iciCall;
21931
- GenTreePtr iciStmt = pInlineInfo->iciStmt;
21932
- BasicBlock* iciBlock = pInlineInfo->iciBlock;
21924
+ GenTreePtr iciCall = pInlineInfo->iciCall;
21925
+ GenTreePtr iciStmt = pInlineInfo->iciStmt;
21926
+ BasicBlock* iciBlock = pInlineInfo->iciBlock;
21933
21927
BasicBlock* block;
21934
21928
21935
21929
// We can write better assert here. For example, we can check that
@@ -22225,17 +22219,17 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo)
22225
22219
if ((pInlineInfo->inlineCandidateInfo->fncRetType != TYP_VOID) || (iciCall->gtCall.gtReturnType == TYP_STRUCT))
22226
22220
{
22227
22221
noway_assert(pInlineInfo->retExpr);
22228
- iciCall->CopyFrom(pInlineInfo->retExpr, this);
22229
-
22230
22222
#ifdef DEBUG
22231
22223
if (verbose)
22232
22224
{
22233
- printf("\nReturn expression for inlinee ");
22225
+ printf("\nReturn expression for call at ");
22234
22226
printTreeID(iciCall);
22235
- printf(" : \n");
22236
- gtDispTree(iciCall );
22227
+ printf(" is \n");
22228
+ gtDispTree(pInlineInfo->retExpr );
22237
22229
}
22238
22230
#endif // DEBUG
22231
+ // Replace the call with the return expression
22232
+ iciCall->CopyFrom(pInlineInfo->retExpr, this);
22239
22233
}
22240
22234
22241
22235
//
0 commit comments