Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/coreclr/jit/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ bool BasicBlock::isBBCallAlwaysPair()
}

//------------------------------------------------------------------------
// isBBCallAlwaysPairTail: Determine if this is the last block of a BBJ_CALLFINALLY/BBJ_ALWAYS pari
// isBBCallAlwaysPairTail: Determine if this is the last block of a BBJ_CALLFINALLY/BBJ_ALWAYS pair
//
// Return Value:
// True iff "this" is the last block of a BBJ_CALLFINALLY/BBJ_ALWAYS pair
Expand Down
25 changes: 16 additions & 9 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,14 @@ void LinearScan::setBlockSequence()
blockInfo[block->bbNum].splitEdgeCount = 0;
#endif // TRACK_LSRA_STATS

// We treat BBCallAlwaysPairTail blocks as having EH flow, since we can't
// insert resolution moves into those blocks.
if (block->isBBCallAlwaysPairTail())
{
blockInfo[block->bbNum].hasEHBoundaryIn = true;
blockInfo[block->bbNum].hasEHBoundaryOut = true;
}

bool hasUniquePred = (block->GetUniquePred(compiler) != nullptr);
for (flowList* pred = block->bbPreds; pred != nullptr; pred = pred->flNext)
{
Expand All @@ -866,15 +874,11 @@ void LinearScan::setBlockSequence()
}
}

// We treat BBCallAlwaysPairTail blocks as having EH flow, since we can't
// insert resolution moves into those blocks.
if (block->isBBCallAlwaysPairTail())
{
blockInfo[block->bbNum].hasEHBoundaryIn = true;
blockInfo[block->bbNum].hasEHBoundaryOut = true;
}
else if (predBlock->hasEHBoundaryOut() || predBlock->isBBCallAlwaysPairTail())
if (!block->isBBCallAlwaysPairTail() &&
(predBlock->hasEHBoundaryOut() || predBlock->isBBCallAlwaysPairTail()))
{
assert(!block->isBBCallAlwaysPairTail());

if (hasUniquePred)
{
// A unique pred with an EH out edge won't allow us to keep any variables enregistered.
Expand Down Expand Up @@ -8208,6 +8212,10 @@ void LinearScan::addResolution(
!blockInfo[block->bbNum].hasEHBoundaryIn);
insertionPointString = "top";
}

// We should never add resolution move inside BBCallAlwaysPairTail.
noway_assert(!block->isBBCallAlwaysPairTail());

#endif // DEBUG

JITDUMP(" " FMT_BB " %s: move V%02u from ", block->bbNum, insertionPointString, interval->varNum);
Expand Down Expand Up @@ -8580,7 +8588,6 @@ void LinearScan::resolveEdges()
}

unsigned succCount = block->NumSucc(compiler);
flowList* preds = block->bbPreds;
BasicBlock* uniquePredBlock = block->GetUniquePred(compiler);

// First, if this block has a single predecessor,
Expand Down