LLVM 22.0.0git
|
Classes | |
struct | AllocaInfo |
class | AnyRetconABI |
class | AsyncABI |
class | BaseABI |
class | BaseCloner |
struct | LowererBase |
struct | Shape |
class | SwitchABI |
class | SwitchCloner |
Typedefs | |
using | SpillInfo = SmallMapVector< Value *, SmallVector< Instruction *, 2 >, 8 > |
Enumerations | |
enum class | ABI { Switch , Retcon , RetconOnce , Async } |
enum class | CloneKind { SwitchResume , SwitchUnwind , SwitchCleanup , Continuation , Async } |
using llvm::coro::SpillInfo = typedef SmallMapVector<Value *, SmallVector<Instruction *, 2>, 8> |
Definition at line 20 of file SpillUtils.h.
|
strong |
Definition at line 26 of file CoroShape.h.
|
strong |
Definition at line 26 of file CoroCloner.h.
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 454 of file SpillUtils.cpp.
References llvm::Alloc, llvm::coro::Shape::CoroBegin, F, I, instructions, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::report_fatal_error().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
void llvm::coro::collectSpillsFromArgs | ( | SpillInfo & | Spills, |
Function & | F, | ||
const SuspendCrossingInfo & | Checker | ||
) |
Definition at line 445 of file SpillUtils.cpp.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
void llvm::coro::collectSpillsFromDbgInfo | ( | SpillInfo & | Spills, |
Function & | F, | ||
const SuspendCrossingInfo & | Checker | ||
) |
Definition at line 509 of file SpillUtils.cpp.
References llvm::findDbgValues().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
CallInst * llvm::coro::createMustTailCall | ( | DebugLoc | Loc, |
Function * | MustTailCallFn, | ||
TargetTransformInfo & | TTI, | ||
ArrayRef< Value * > | Arguments, | ||
IRBuilder<> & | Builder | ||
) |
Definition at line 1690 of file CoroSplit.cpp.
References Arguments, coerceArguments(), llvm::IRBuilderBase::CreateCall(), llvm::Function::getCallingConv(), llvm::Function::getFunctionType(), llvm::TargetTransformInfo::supportsTailCallFor(), and llvm::CallInst::TCK_MustTail.
Referenced by normalizeCoroutine(), and llvm::coro::AsyncABI::splitCoroutine().
Definition at line 102 of file Coroutines.cpp.
References declaresIntrinsics(), and NonOverloadedCoroIntrinsics.
Referenced by llvm::CoroConditionalWrapper::run().
bool llvm::coro::declaresIntrinsics | ( | const Module & | M, |
ArrayRef< Intrinsic::ID > | List | ||
) |
Definition at line 107 of file Coroutines.cpp.
References assert(), llvm::Intrinsic::getDeclarationIfExists(), llvm::Intrinsic::isOverloaded(), and llvm::List.
Referenced by declaresAnyIntrinsic(), declaresCoroCleanupIntrinsics(), declaresCoroEarlyIntrinsics(), and llvm::CoroElidePass::run().
bool llvm::coro::defaultMaterializable | ( | Instruction & | V | ) |
Default materializable callback.
Definition at line 236 of file MaterializationUtils.cpp.
Referenced by isTriviallyMaterializable().
void llvm::coro::doRematerializations | ( | Function & | F, |
SuspendCrossingInfo & | Checker, | ||
std::function< bool(Instruction &)> | IsMaterializable | ||
) |
Definition at line 257 of file MaterializationUtils.cpp.
References 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().
BasicBlock::iterator llvm::coro::getSpillInsertionPt | ( | const coro::Shape & | Shape, |
Value * | Def, | ||
const DominatorTree & | DT | ||
) |
Definition at line 575 of file SpillUtils.cpp.
References assert(), llvm::coro::Shape::CoroBegin, llvm::BasicBlock::getFirstInsertionPt(), llvm::coro::Shape::getInsertPtAfterFramePtr(), llvm::BasicBlock::getTerminator(), I, II, and llvm::SplitEdge().
Referenced by insertSpills().
bool llvm::coro::isSuspendBlock | ( | BasicBlock * | BB | ) |
Definition at line 98 of file Coroutines.cpp.
References llvm::BasicBlock::front().
Referenced by sinkLifetimeStartMarkers(), and willLeaveFunctionImmediatelyAfter().
bool llvm::coro::isTriviallyMaterializable | ( | Instruction & | I | ) |
Definition at line 241 of file MaterializationUtils.cpp.
References defaultMaterializable().
Referenced by llvm::CoroSplitPass::CoroSplitPass().
void llvm::coro::normalizeCoroutine | ( | Function & | F, |
coro::Shape & | Shape, | ||
TargetTransformInfo & | TTI | ||
) |
Definition at line 1957 of file CoroFrame.cpp.
References llvm::coro::Shape::ABI, Arguments, cleanupSinglePredPHIs(), llvm::CoroIdInst::clearPromise(), llvm::coro::Shape::CoroEnds, llvm::coro::Shape::CoroSuspends, createMustTailCall(), llvm::ArrayRef< T >::drop_front(), eliminateSwiftError(), F, llvm::coro::Shape::getSwitchCoroId(), llvm::coro::Shape::SwitchLoweringStorage::PromiseAlloca, rewritePHIs(), splitAround(), and llvm::coro::Shape::SwitchLowering.
Referenced by doSplitCoroutine().
void llvm::coro::replaceCoroFree | ( | CoroIdInst * | CoroId, |
bool | Elide | ||
) |
Definition at line 122 of file Coroutines.cpp.
References llvm::SmallVectorBase< Size_T >::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().
void llvm::coro::salvageDebugInfo | ( | SmallDenseMap< Argument *, AllocaInst *, 4 > & | ArgToAllocaMap, |
DbgVariableRecord & | DVR, | ||
bool | UseEntryValue | ||
) |
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 1913 of file CoroFrame.cpp.
References F, llvm::DbgRecord::getDebugLoc(), llvm::DbgVariableRecord::getExpression(), llvm::DbgRecord::getFunction(), llvm::DbgVariableRecord::getType(), llvm::DbgVariableRecord::getVariableLocationOp(), I, llvm::DbgVariableRecord::isDbgDeclare(), llvm::DbgRecord::removeFromParent(), llvm::DbgVariableRecord::replaceVariableLocationOp(), salvageDebugInfoImpl(), llvm::DbgRecord::setDebugLoc(), and llvm::DbgVariableRecord::setExpression().
Referenced by llvm::coro::BaseCloner::create(), doSplitCoroutine(), insertSpills(), and llvm::coro::BaseCloner::salvageDebugInfo().
void llvm::coro::sinkSpillUsesAfterCoroBegin | ( | const DominatorTree & | DT, |
CoroBeginInst * | CoroBegin, | ||
coro::SpillInfo & | Spills, | ||
SmallVectorImpl< coro::AllocaInfo > & | Allocas | ||
) |
Async and Retcon{Once} conventions assume that all spill uses can be sunk after the coro.begin intrinsic.
Definition at line 528 of file SpillUtils.cpp.
References A, B, llvm::SetVector< T, Vector, Set, N >::begin(), llvm::DominatorTree::dominates(), llvm::SmallVectorBase< Size_T >::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().
void llvm::coro::suppressCoroAllocs | ( | CoroIdInst * | CoroId | ) |
Replaces all @llvm.coro.alloc intrinsics calls associated with a given call @llvm.coro.id instruction with boolean value false.
Definition at line 142 of file Coroutines.cpp.
References llvm::SmallVectorBase< Size_T >::empty(), llvm::Value::getContext(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), suppressCoroAllocs(), and llvm::Value::users().
Referenced by suppressCoroAllocs().
void llvm::coro::suppressCoroAllocs | ( | LLVMContext & | Context, |
ArrayRef< CoroAllocInst * > | CoroAllocs | ||
) |
Replaces CoroAllocs with boolean value false.
Definition at line 160 of file Coroutines.cpp.
References Context, and llvm::ConstantInt::getFalse().