LLVM 20.0.0git
Classes | Enumerations | Functions
llvm::coro Namespace Reference

Classes

struct  LowererBase
 
struct  Shape
 

Enumerations

enum class  ABI { Switch , Retcon , RetconOnce , Async }
 

Functions

bool declaresAnyIntrinsic (const Module &M)
 
bool declaresIntrinsics (const Module &M, const std::initializer_list< StringRef >)
 
void replaceCoroFree (CoroIdInst *CoroId, bool Elide)
 
void salvageDebugInfo (SmallDenseMap< Argument *, AllocaInst *, 4 > &ArgToAllocaMap, DbgVariableIntrinsic &DVI, bool IsEntryPoint)
 Attempts to rewrite the location operand of debug intrinsics in terms of the coroutine frame pointer, folding pointer offsets into the DIExpression of the intrinsic.
 
void salvageDebugInfo (SmallDenseMap< Argument *, AllocaInst *, 4 > &ArgToAllocaMap, DbgVariableRecord &DVR, bool UseEntryValue)
 
bool defaultMaterializable (Instruction &V)
 Default materializable callback.
 
void buildCoroutineFrame (Function &F, Shape &Shape, TargetTransformInfo &TTI, const std::function< bool(Instruction &)> &MaterializableCallback)
 
CallInstcreateMustTailCall (DebugLoc Loc, Function *MustTailCallFn, TargetTransformInfo &TTI, ArrayRef< Value * > Arguments, IRBuilder<> &)
 

Enumeration Type Documentation

◆ ABI

enum class llvm::coro::ABI
strong
Enumerator
Switch 

The "resume-switch" lowering, where there are separate resume and destroy functions that are shared between all suspend points.

The coroutine frame implicitly stores the resume and destroy functions, the current index, and any promise value.

Retcon 

The "returned-continuation" lowering, where each suspend point creates a single continuation function that is used for both resuming and destroying.

Does not support promises.

RetconOnce 

The "unique returned-continuation" lowering, where each suspend point creates a single continuation function that is used for both resuming and destroying.

Does not support promises. The function is known to suspend at most once during its execution, and the return value of the continuation is void.

Async 

The "async continuation" lowering, where each suspend point creates a single continuation function.

The continuation function is available as an intrinsic.

Definition at line 53 of file CoroInternal.h.

Function Documentation

◆ buildCoroutineFrame()

void llvm::coro::buildCoroutineFrame ( Function F,
Shape Shape,
TargetTransformInfo TTI,
const std::function< bool(Instruction &)> &  MaterializableCallback 
)

◆ createMustTailCall()

CallInst * llvm::coro::createMustTailCall ( DebugLoc  Loc,
Function MustTailCallFn,
TargetTransformInfo TTI,
ArrayRef< Value * >  Arguments,
IRBuilder<> &  Builder 
)

◆ declaresAnyIntrinsic()

bool llvm::coro::declaresAnyIntrinsic ( const Module M)

Definition at line 103 of file Coroutines.cpp.

References assert(), CoroIntrinsics, isCoroutineIntrinsicName(), and Name.

Referenced by llvm::CoroConditionalWrapper::run().

◆ declaresIntrinsics()

bool llvm::coro::declaresIntrinsics ( const Module M,
const std::initializer_list< StringRef List 
)

◆ defaultMaterializable()

bool llvm::coro::defaultMaterializable ( Instruction V)

Default materializable callback.

Definition at line 2278 of file CoroFrame.cpp.

◆ replaceCoroFree()

void llvm::coro::replaceCoroFree ( CoroIdInst CoroId,
bool  Elide 
)

◆ salvageDebugInfo() [1/2]

void llvm::coro::salvageDebugInfo ( SmallDenseMap< Argument *, AllocaInst *, 4 > &  ArgToAllocaMap,
DbgVariableIntrinsic DVI,
bool  IsEntryPoint 
)

Attempts to rewrite the location operand of debug intrinsics in terms of the coroutine frame pointer, folding pointer offsets into the DIExpression of the intrinsic.

If the frame pointer is an Argument, store it into an alloca to enhance the debugability.

Definition at line 2930 of file CoroFrame.cpp.

References F, llvm::Instruction::getDebugLoc(), llvm::DbgVariableIntrinsic::getExpression(), llvm::Instruction::getFunction(), llvm::DbgVariableIntrinsic::getVariableLocationOp(), I, llvm::Instruction::moveBefore(), llvm::DbgVariableIntrinsic::replaceVariableLocationOp(), salvageDebugInfoImpl(), llvm::Instruction::setDebugLoc(), and llvm::DbgVariableIntrinsic::setExpression().

Referenced by insertSpills(), and splitCoroutine().

◆ salvageDebugInfo() [2/2]

void llvm::coro::salvageDebugInfo ( SmallDenseMap< Argument *, AllocaInst *, 4 > &  ArgToAllocaMap,
DbgVariableRecord DVR,
bool  UseEntryValue 
)