Skip to content

Commit c9e01a5

Browse files
authored
JIT: Copy BBF_ASYNC_RESUMPTION when splitting edges in LSRA (#115836)
Async resumption BBs are introduced late enough that we allow them to do some things that general BBs are not allowed to do. For example, they are allowed to jump into try regions at any point. This allowance is marked with the `BBF_ASYNC_RESUMPTION` flag. Propagate this flag from the source when edges are split by LSRA to allow the new block the same affordances.
1 parent 2fdfad5 commit c9e01a5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/coreclr/jit/fgbasic.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,6 +4968,10 @@ BasicBlock* Compiler::fgSplitEdge(BasicBlock* curr, BasicBlock* succ)
49684968
}
49694969
newBlock->CopyFlags(curr, succ->GetFlagsRaw() & BBF_BACKWARD_JUMP);
49704970

4971+
// Async resumption stubs are permitted to branch into EH regions, so if we
4972+
// split such a branch we should also copy this flag.
4973+
newBlock->CopyFlags(curr, BBF_ASYNC_RESUMPTION);
4974+
49714975
JITDUMP("Splitting edge from " FMT_BB " to " FMT_BB "; adding " FMT_BB "\n", curr->bbNum, succ->bbNum,
49724976
newBlock->bbNum);
49734977

src/coreclr/jit/fgdiagnostic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@ bool BBPredsChecker::CheckEhTryDsc(BasicBlock* block, BasicBlock* blockPred, EHb
27142714
return true;
27152715
}
27162716

2717-
printf("Jump into the middle of try region: " FMT_BB " branches to " FMT_BB "\n", blockPred->bbNum, block->bbNum);
2717+
JITDUMP("Jump into the middle of try region: " FMT_BB " branches to " FMT_BB "\n", blockPred->bbNum, block->bbNum);
27182718
assert(!"Jump into middle of try region");
27192719
return false;
27202720
}
@@ -2746,8 +2746,8 @@ bool BBPredsChecker::CheckEhHndDsc(BasicBlock* block, BasicBlock* blockPred, EHb
27462746
return true;
27472747
}
27482748

2749-
printf("Jump into the middle of handler region: " FMT_BB " branches to " FMT_BB "\n", blockPred->bbNum,
2750-
block->bbNum);
2749+
JITDUMP("Jump into the middle of handler region: " FMT_BB " branches to " FMT_BB "\n", blockPred->bbNum,
2750+
block->bbNum);
27512751
assert(!"Jump into the middle of handler region");
27522752
return false;
27532753
}

0 commit comments

Comments
 (0)