llvm::isPresplitCoroSuspendExitEdge

Return true if Src to Dest is a presplit coroutine suspend exit edge.

Synopsis

Declared in <llvm/Analysis/CFG.h>

bool
isPresplitCoroSuspendExitEdge(
    BasicBlock const& Src,
    BasicBlock const& Dest);

Description

Returns true if these basic blocks belong to a presplit coroutine and the edge corresponds to the 'default' case in the switch statement in the pattern:

%0 = call i8 llvm.coro.suspend(token none, i1 false) switch i8 %0, label %suspend [i8 0, label %resume] i8 1, label %cleanup]

i.e. the edge to the %suspend BB. This edge is special in that it will be elided by coroutine lowering (coro-split), and the %suspend BB needs to be kept as-is. It's not a real CFG edge - post-lowering, it will end up being a ret, and it must be thus lowerable to support symmetric transfer. For example:

  • this edge is not a loop exit edge if encountered in a loop (and should be ignored)

  • must not be split for PGO instrumentation, for example.

Return Value

True if the edge is a presplit coroutine suspend exit edge.

Parameters

NameDescription
SrcSource basic block of the candidate edge.
DestDestination basic block of the candidate edge.