Skip to content
Closed
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
9 changes: 0 additions & 9 deletions src/coreclr/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2307,15 +2307,6 @@ PhaseStatus Compiler::fgAddInternal()
// type with a runtime lookup
madeChanges |= fgCreateFiltersForGenericExceptions();

// The backend requires a scratch BB into which it can safely insert a P/Invoke method prolog if one is
// required. Similarly, we need a scratch BB for poisoning and when we have Swift parameters to reassemble.
// Create it here.
if (compMethodRequiresPInvokeFrame() || compShouldPoisonFrame() || lvaHasAnySwiftStackParamToReassemble())
{
madeChanges |= fgEnsureFirstBBisScratch();
fgFirstBB->SetFlags(BBF_DONT_REMOVE);
}

/*
<BUGNUM> VSW441487 </BUGNUM>

Expand Down
12 changes: 12 additions & 0 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7812,6 +7812,18 @@ void Lowering::WidenSIMD12IfNecessary(GenTreeLclVarCommon* node)

PhaseStatus Lowering::DoPhase()
{
// We need a scratch BB into which it can safely insert a P/Invoke method
// prolog if one is required. Similarly, we need a scratch BB for poisoning
// and when we have Swift parameters to reassemble. Create it here.
if (comp->compMethodRequiresPInvokeFrame() || comp->compShouldPoisonFrame() ||
comp->lvaHasAnySwiftStackParamToReassemble())
{
if (comp->fgEnsureFirstBBisScratch())
{
comp->fgInvalidateDfsTree();
}
}

// If we have any PInvoke calls, insert the one-time prolog code. We'll insert the epilog code in the
// appropriate spots later. NOTE: there is a minor optimization opportunity here, as we still create p/invoke
// data structures and setup/teardown even if we've eliminated all p/invoke calls due to dead code elimination.
Expand Down
Loading