Skip to content

[Linux-arm] Do not add resolution move in BBCallAlwaysPairTail #48828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 2, 2021
Merged
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
@@ -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
25 changes: 16 additions & 9 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
@@ -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)
{
@@ -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.
@@ -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);
@@ -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,