Skip to content

Commit f2d5042

Browse files
AndyAyersMSCopilot
andauthored
JIT: remove dead BBJ_RETURN-in-loop assertion in loop cloner (#128791)
Loops no longer have returns, so remove some stale comments and checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 545776c commit f2d5042

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

src/coreclr/jit/loopcloning.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,10 +1906,6 @@ void Compiler::optPerformStaticOptimizations(FlowGraphNaturalLoop* loop,
19061906
// Returns true if the loop can be cloned. If it returns false,
19071907
// it prints a message to the JIT dump describing why the loop can't be cloned.
19081908
//
1909-
// Notes: if `true` is returned, then `fgReturnCount` is increased by the number of
1910-
// return blocks in the loop that will be cloned. (REVIEW: this 'predicate' function
1911-
// doesn't seem like the right place to do this change.)
1912-
//
19131909
bool Compiler::optIsLoopClonable(FlowGraphNaturalLoop* loop, LoopCloneContext* context)
19141910
{
19151911
if (loop->GetHeader()->isRunRarely())
@@ -1945,20 +1941,6 @@ bool Compiler::optIsLoopClonable(FlowGraphNaturalLoop* loop, LoopCloneContext* c
19451941
return false;
19461942
}
19471943

1948-
#ifdef DEBUG
1949-
// Today we will never see any BBJ_RETURN blocks because we cannot
1950-
// duplicate loops with EH in them. When we have no try-regions that start
1951-
// in the loop it is not possible for BBJ_RETURN blocks to be part of the
1952-
// loop; a BBJ_RETURN block can only be part of the loop if its exceptional
1953-
// flow can reach the header, but that would require the handler to also be
1954-
// part of the loop, which guarantees that the loop contains two distinct
1955-
// EH regions.
1956-
loop->VisitLoopBlocks([](BasicBlock* block) {
1957-
assert(!block->KindIs(BBJ_RETURN));
1958-
return BasicBlockVisit::Continue;
1959-
});
1960-
#endif
1961-
19621944
// Is the entry block a handler or filter start? If so, then if we cloned, we could create a jump
19631945
// into the middle of a handler (to go to the cloned copy.) Reject.
19641946
// TODO: This seems like it can be deleted. If the header is the beginning

0 commit comments

Comments
 (0)