LLVM: llvm::coro Namespace Reference (original) (raw)
| Classes | |
|---|---|
| struct | AllocaInfo |
| class | AnyRetconABI |
| class | AsyncABI |
| class | BaseABI |
| class | BaseCloner |
| struct | LowererBase |
| struct | Shape |
| class | SwitchABI |
| class | SwitchCloner |
| Enumerations | |
|---|---|
| enum class | ABI { Switch, Retcon, RetconOnce, Async } |
| enum class | CloneKind { SwitchResume, SwitchUnwind, SwitchCleanup, Continuation, Async } |
◆ SpillInfo
◆ 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 26 of file CoroShape.h.
◆ CloneKind
| enum class llvm::coro::CloneKind | strong |
|---|
| Enumerator | |
|---|---|
| SwitchResume | The shared resume function for a switch lowering. |
| SwitchUnwind | The shared unwind function for a switch lowering. |
| SwitchCleanup | The shared cleanup function for a switch lowering. |
| Continuation | An individual continuation function. |
| Async | An async resume function. |
Definition at line 25 of file CoroCloner.h.
◆ collectSpillsAndAllocasFromInsts()
| void llvm::coro::collectSpillsAndAllocasFromInsts | ( | SpillInfo & | Spills, |
|---|---|---|---|
| SmallVector< AllocaInfo, 8 > & | Allocas, | ||
| SmallVector< Instruction *, 4 > & | DeadInstructions, | ||
| SmallVector< CoroAllocaAllocInst *, 4 > & | LocalAllocas, | ||
| Function & | F, | ||
| const SuspendCrossingInfo & | Checker, | ||
| const DominatorTree & | DT, | ||
| const coro::Shape & | Shape ) |
Definition at line 459 of file SpillUtils.cpp.
References llvm::Alloc, llvm::cast(), collectFrameAlloca(), llvm::coro::Shape::CoroBegin, llvm::dyn_cast(), F, I, instructions, llvm::isa(), llvm::SuspendCrossingInfo::isDefinitionAcrossSuspend(), isLocalAlloca(), isNonSpilledIntrinsic(), lowerNonLocalAlloca(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::report_fatal_error().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
◆ collectSpillsFromArgs()
◆ collectSpillsFromDbgInfo()
◆ createMustTailCall()
◆ declaresAnyIntrinsic()
◆ declaresIntrinsics()
◆ defaultMaterializable()
◆ doRematerializations()
Definition at line 254 of file MaterializationUtils.cpp.
References llvm::cast(), llvm::dbgs(), dumpRemats(), F, I, instructions, llvm::SuspendCrossingInfo::isDefinitionAcrossSuspend(), LLVM_DEBUG, rewriteMaterializableInstructions(), and llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
◆ getSpillInsertionPt()
Definition at line 579 of file SpillUtils.cpp.
References assert(), llvm::cast(), llvm::coro::Shape::CoroBegin, llvm::DominatorTree::dominates(), llvm::dyn_cast(), llvm::BasicBlock::getFirstInsertionPt(), llvm::coro::Shape::getInsertPtAfterFramePtr(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::BasicBlock::getTerminator(), I, II, llvm::isa(), splitBeforeCatchSwitch(), and llvm::SplitEdge().
Referenced by insertSpills().
◆ isSuspendBlock()
◆ isTriviallyMaterializable()
◆ normalizeCoroutine()
Definition at line 2021 of file CoroFrame.cpp.
References llvm::coro::Shape::ABI, Arguments, llvm::ArrayRef(), Async, Call, cleanupSinglePredPHIs(), llvm::CoroIdInst::clearPromise(), llvm::coro::Shape::CoroEnds, llvm::coro::Shape::CoroSuspends, createMustTailCall(), llvm::dyn_cast(), eliminateSwiftError(), F, llvm::coro::Shape::getSwitchCoroId(), llvm::coro::Shape::SwitchLoweringStorage::PromiseAlloca, rewritePHIs(), splitAround(), Switch, and llvm::coro::Shape::SwitchLowering.
Referenced by doSplitCoroutine().
◆ replaceCoroFree()
Definition at line 123 of file Coroutines.cpp.
References llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::ConstantPointerNull::get(), llvm::PointerType::get(), llvm::Value::getContext(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Value::users().
Referenced by llvm::coro::SwitchCloner::create(), and handleNoSuspendCoroutine().
◆ salvageDebugInfo()
Attempts to rewrite the location operand of debug records 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 1963 of file CoroFrame.cpp.
References llvm::DbgVariableRecord::Declare, llvm::DbgVariableRecord::DeclareValue, llvm::dyn_cast(), F, llvm::DbgRecord::getDebugLoc(), llvm::DbgVariableRecord::getExpression(), llvm::DbgRecord::getFunction(), llvm::DbgVariableRecord::getRawLocation(), llvm::DbgVariableRecord::getType(), llvm::DbgVariableRecord::getVariableLocationOp(), I, llvm::isa(), llvm::DbgVariableRecord::isDbgDeclare(), llvm::DbgVariableRecord::isDbgDeclareValue(), llvm::DbgRecord::removeFromParent(), llvm::DbgVariableRecord::replaceVariableLocationOp(), llvm::salvageDebugInfoImpl(), llvm::DbgRecord::setDebugLoc(), llvm::DbgVariableRecord::setExpression(), llvm::DbgVariableRecord::Type, and llvm::DbgVariableRecord::Value.
Referenced by llvm::coro::BaseCloner::create(), doSplitCoroutine(), insertSpills(), and llvm::coro::BaseCloner::salvageDebugInfo().
◆ sinkSpillUsesAfterCoroBegin()
Async and Retcon{Once} conventions assume that all spill uses can be sunk after the coro.begin intrinsic.
Definition at line 533 of file SpillUtils.cpp.
References A(), B(), llvm::SetVector< T, Vector, Set, N >::begin(), llvm::cast(), llvm::DominatorTree::dominates(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::SetVector< T, Vector, Set, N >::end(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), I, llvm::SetVector< T, Vector, Set, N >::insert(), llvm::Instruction::moveBefore(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::sort().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
◆ suppressCoroAllocs() [1/2]
| void llvm::coro::suppressCoroAllocs | ( | CoroIdInst * | CoroId | ) |
|---|