Skip to content

Commit 1f95d65

Browse files
committed
Use BBF_IMPORTER for new blocks in helperexpansion.cpp
1 parent 211e8db commit 1f95d65

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/coreclr/jit/helperexpansion.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ bool Compiler::fgExpandRuntimeLookupsForCall(BasicBlock** pBlock, Statement* stm
242242
}
243243

244244
GenTree* ctxTree = call->gtArgs.GetArgByIndex(0)->GetNode();
245-
GenTree* sigNode = call->gtArgs.GetArgByIndex(1)->GetNode();
246245

247246
// Prepare slotPtr tree (TODO: consider sharing this part with impRuntimeLookup)
248247
GenTree* slotPtrTree = gtCloneExpr(ctxTree);
@@ -442,6 +441,23 @@ bool Compiler::fgExpandRuntimeLookupsForCall(BasicBlock** pBlock, Statement* stm
442441
fallbackBb->inheritWeightPercentage(nullcheckBb, 20);
443442
}
444443

444+
if (prevBb->HasFlag(BBF_IMPORTED))
445+
{
446+
nullcheckBb->RemoveFlags(BBF_INTERNAL);
447+
nullcheckBb->SetFlags(BBF_IMPORTED);
448+
449+
fastPathBb->RemoveFlags(BBF_INTERNAL);
450+
fastPathBb->SetFlags(BBF_IMPORTED);
451+
452+
if (needsSizeCheck)
453+
{
454+
sizeCheckBb->RemoveFlags(BBF_INTERNAL);
455+
sizeCheckBb->SetFlags(BBF_IMPORTED);
456+
}
457+
458+
assert(block->HasFlag(BBF_IMPORTED));
459+
}
460+
445461
// All blocks are expected to be in the same EH region
446462
assert(BasicBlock::sameEHRegion(prevBb, block));
447463
assert(BasicBlock::sameEHRegion(prevBb, nullcheckBb));
@@ -1546,6 +1562,14 @@ bool Compiler::fgExpandStaticInitForCall(BasicBlock** pBlock, Statement* stmt, G
15461562
isInitedBb->inheritWeight(prevBb);
15471563
helperCallBb->inheritWeightPercentage(isInitedBb, 0);
15481564

1565+
if (prevBb->HasFlag(BBF_IMPORTED))
1566+
{
1567+
isInitedBb->RemoveFlags(BBF_INTERNAL);
1568+
isInitedBb->SetFlags(BBF_IMPORTED);
1569+
1570+
assert(block->HasFlag(BBF_IMPORTED));
1571+
}
1572+
15491573
// All blocks are expected to be in the same EH region
15501574
assert(BasicBlock::sameEHRegion(prevBb, block));
15511575
assert(BasicBlock::sameEHRegion(prevBb, isInitedBb));

0 commit comments

Comments
 (0)