LLVM 20.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 25 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 461 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 452 of file SpillUtils.cpp.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
void llvm::coro::collectSpillsFromDbgInfo | ( | SpillInfo & | Spills, |
Function & | F, | ||
const SuspendCrossingInfo & | Checker | ||
) |
Definition at line 516 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 1664 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 111 of file Coroutines.cpp.
References CoroIntrinsics, and Name.
Referenced by llvm::CoroConditionalWrapper::run().
bool llvm::coro::declaresIntrinsics | ( | const Module & | M, |
const std::initializer_list< StringRef > | List | ||
) |
Definition at line 122 of file Coroutines.cpp.
References assert(), isCoroutineIntrinsicName(), llvm::List, and Name.
Referenced by declaresCoroCleanupIntrinsics(), declaresCoroEarlyIntrinsics(), and llvm::CoroElidePass::run().
bool llvm::coro::defaultMaterializable | ( | Instruction & | V | ) |
Default materializable callback.
Definition at line 235 of file MaterializationUtils.cpp.
Referenced by isTriviallyMaterializable().
void llvm::coro::doRematerializations | ( | Function & | F, |
SuspendCrossingInfo & | Checker, | ||
std::function< bool(Instruction &)> | IsMaterializable | ||
) |
Definition at line 256 of file MaterializationUtils.cpp.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count(), llvm::dbgs(), dumpRemats(), F, I, instructions, llvm::SuspendCrossingInfo::isDefinitionAcrossSuspend(), LLVM_DEBUG, and rewriteMaterializableInstructions().
Referenced by llvm::coro::BaseABI::buildCoroutineFrame().
BasicBlock::iterator llvm::coro::getSpillInsertionPt | ( | const coro::Shape & | Shape, |
Value * | Def, | ||
const DominatorTree & | DT | ||
) |
Definition at line 586 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 107 of file Coroutines.cpp.
References llvm::BasicBlock::front().
Referenced by sinkLifetimeStartMarkers(), and willLeaveFunctionImmediatelyAfter().
bool llvm::coro::isTriviallyMaterializable | ( | Instruction & | I | ) |
Definition at line 240 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 2013 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 135 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, |
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 1927 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 llvm::coro::BaseCloner::create(), doSplitCoroutine(), insertSpills(), and llvm::coro::BaseCloner::salvageDebugInfo().
void llvm::coro::salvageDebugInfo | ( | SmallDenseMap< Argument *, AllocaInst *, 4 > & | ArgToAllocaMap, |
DbgVariableRecord & | DVR, | ||
bool | UseEntryValue | ||
) |
Definition at line 1969 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().
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 539 of file SpillUtils.cpp.
References A, B, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::begin(), llvm::SetVector< T, Vector, Set, N >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::DominatorTree::dominates(), llvm::SmallVectorBase< Size_T >::empty(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), llvm::SetVector< T, Vector, Set, N >::end(), llvm::SmallVectorTemplateCommon< T, typename >::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 155 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 173 of file Coroutines.cpp.
References llvm::ConstantInt::getFalse().