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 = SmallMapVector<Value *, SmallVector<Instruction *, 2>, 8> |
Definition at line 18 of file SpillUtils.h.
|
strong |
Definition at line 26 of file CoroShape.h.
|
strong |
Definition at line 25 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 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().
void llvm::coro::collectSpillsFromArgs | ( | SpillInfo & | Spills, |
Function & | F, | ||
const SuspendCrossingInfo & | Checker ) |
Definition at line 450 of file SpillUtils.cpp.
References A(), llvm::cast(), F, and llvm::SuspendCrossingInfo::isDefinitionAcrossSuspend().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
void llvm::coro::collectSpillsFromDbgInfo | ( | SpillInfo & | Spills, |
Function & | F, | ||
const SuspendCrossingInfo & | Checker ) |
Definition at line 514 of file SpillUtils.cpp.
References F, llvm::findDbgValues(), and llvm::SuspendCrossingInfo::isDefinitionAcrossSuspend().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
CallInst * llvm::coro::createMustTailCall | ( | DebugLoc | Loc, |
Function * | MustTailCallFn, | ||
TargetTransformInfo & | TTI, | ||
ArrayRef< Value * > | Arguments, | ||
IRBuilder<> & | Builder ) |
Definition at line 1698 of file CoroSplit.cpp.
References Arguments, coerceArguments(), llvm::Function::getCallingConv(), llvm::Function::getFunctionType(), and llvm::CallInst::TCK_MustTail.
Referenced by normalizeCoroutine(), and llvm::coro::AsyncABI::splitCoroutine().
Definition at line 103 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 108 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 233 of file MaterializationUtils.cpp.
References llvm::isa().
Referenced by isTriviallyMaterializable().
void llvm::coro::doRematerializations | ( | Function & | F, |
SuspendCrossingInfo & | Checker, | ||
std::function< bool(Instruction &)> | IsMaterializable ) |
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().
BasicBlock::iterator llvm::coro::getSpillInsertionPt | ( | const coro::Shape & | Shape, |
Value * | Def, | ||
const DominatorTree & | DT ) |
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().
bool llvm::coro::isSuspendBlock | ( | BasicBlock * | BB | ) |
Definition at line 99 of file Coroutines.cpp.
References llvm::BasicBlock::front(), and llvm::isa().
Referenced by isSuspendReachableFrom(), sinkLifetimeStartMarkers(), and willLeaveFunctionImmediatelyAfter().
bool llvm::coro::isTriviallyMaterializable | ( | Instruction & | I | ) |
Definition at line 238 of file MaterializationUtils.cpp.
References defaultMaterializable().
Referenced by llvm::CoroSplitPass::CoroSplitPass(), and llvm::CoroSplitPass::CoroSplitPass().
void llvm::coro::normalizeCoroutine | ( | Function & | F, |
coro::Shape & | Shape, | ||
TargetTransformInfo & | TTI ) |
Definition at line 1965 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().
void llvm::coro::replaceCoroFree | ( | CoroIdInst * | CoroId, |
bool | Elide ) |
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().
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 1921 of file CoroFrame.cpp.
References llvm::DbgVariableRecord::Declare, llvm::dyn_cast(), F, llvm::DbgRecord::getDebugLoc(), llvm::DbgVariableRecord::getExpression(), llvm::DbgRecord::getFunction(), llvm::DbgVariableRecord::getType(), llvm::DbgVariableRecord::getVariableLocationOp(), I, llvm::isa(), llvm::DbgVariableRecord::isDbgDeclare(), llvm::DbgRecord::removeFromParent(), llvm::DbgVariableRecord::replaceVariableLocationOp(), llvm::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 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().
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 143 of file Coroutines.cpp.
References llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::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 161 of file Coroutines.cpp.
References llvm::ConstantInt::getFalse().