File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
llvm/include/llvm/Transforms/Utils Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -706,6 +706,22 @@ void InvertBranch(BranchInst *PBI, IRBuilderBase &Builder);
706
706
// br/brcond/unreachable/ret
707
707
bool hasOnlySimpleTerminator (const Function &F);
708
708
709
+ // Returns true if these basic blocks belong to a presplit coroutine and the
710
+ // edge corresponds to the 'default' case in the switch statement in the
711
+ // pattern:
712
+ //
713
+ // %0 = call i8 @llvm.coro.suspend(token none, i1 false)
714
+ // switch i8 %0, label %suspend [i8 0, label %resume
715
+ // i8 1, label %cleanup]
716
+ //
717
+ // i.e. the edge to the `%suspend` BB. This edge is special in that it will
718
+ // be elided by coroutine lowering (coro-split), and the `%suspend` BB needs
719
+ // to be kept as-is. It's not a real CFG edge - post-lowering, it will end
720
+ // up being a `ret`, and it must be thus lowerable to support symmetric
721
+ // transfer. For example:
722
+ // - this edge is not a loop exit edge if encountered in a loop (and should
723
+ // be ignored)
724
+ // - must not be split for PGO instrumentation, for example.
709
725
bool isPresplitCoroSuspendExitEdge (const BasicBlock &Src,
710
726
const BasicBlock &Dest);
711
727
} // end namespace llvm
You can’t perform that action at this time.
0 commit comments