LLVM 20.0.0git
|
#include "llvm/Transforms/Coroutines/CoroShape.h"
Classes | |
struct | AsyncLoweringStorage |
struct | RetconLoweringStorage |
struct | SwitchFieldIndex |
struct | SwitchLoweringStorage |
Public Attributes | |
CoroBeginInst * | CoroBegin = nullptr |
SmallVector< AnyCoroEndInst *, 4 > | CoroEnds |
SmallVector< CoroSizeInst *, 2 > | CoroSizes |
SmallVector< CoroAlignInst *, 2 > | CoroAligns |
SmallVector< AnyCoroSuspendInst *, 4 > | CoroSuspends |
SmallVector< CoroAwaitSuspendInst *, 4 > | CoroAwaitSuspends |
SmallVector< CallInst *, 2 > | SymmetricTransfers |
SmallVector< CallInst *, 2 > | SwiftErrorOps |
coro::ABI | ABI |
StructType * | FrameTy = nullptr |
Align | FrameAlign |
uint64_t | FrameSize = 0 |
Value * | FramePtr = nullptr |
BasicBlock * | AllocaSpillBlock = nullptr |
union { | |
SwitchLoweringStorage SwitchLowering | |
RetconLoweringStorage RetconLowering | |
AsyncLoweringStorage AsyncLowering | |
}; | |
Definition at line 52 of file CoroShape.h.
|
default |
|
inlineexplicit |
Definition at line 265 of file CoroShape.h.
References analyze(), cleanCoroutine(), CoroBegin, F, and invalidateCoroutine().
void coro::Shape::analyze | ( | Function & | F, |
SmallVectorImpl< CoroFrameInst * > & | CoroFrames, | ||
SmallVectorImpl< CoroSaveInst * > & | UnusedCoroSaves | ||
) |
Definition at line 194 of file Coroutines.cpp.
References llvm::coro::Async, F, I, II, instructions, llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), llvm::coro::Retcon, llvm::coro::RetconOnce, std::swap(), and llvm::coro::Switch.
Referenced by Shape().
void coro::Shape::cleanCoroutine | ( | SmallVectorImpl< CoroFrameInst * > & | CoroFrames, |
SmallVectorImpl< CoroSaveInst * > & | UnusedCoroSaves | ||
) |
Definition at line 479 of file Coroutines.cpp.
References llvm::SmallVectorImpl< T >::clear().
Referenced by Shape().
|
inline |
Definition at line 64 of file CoroShape.h.
References AllocaSpillBlock, CoroAligns, CoroAwaitSuspends, CoroBegin, CoroEnds, CoroSizes, CoroSuspends, FramePtr, FrameTy, SwiftErrorOps, and SymmetricTransfers.
Allocate memory according to the rules of the active lowering.
CG | - if non-null, will be updated for the new call |
Definition at line 505 of file Coroutines.cpp.
References addCallToCallGraph(), llvm::Alloc, llvm::coro::Async, llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::CreateIntCast(), llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, llvm::coro::RetconOnce, Size, and llvm::coro::Switch.
Referenced by llvm::coro::AnyRetconABI::splitCoroutine().
Deallocate memory according to the rules of the active lowering.
CG | - if non-null, will be updated for the new call |
Definition at line 528 of file Coroutines.cpp.
References addCallToCallGraph(), llvm::coro::Async, llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateCall(), llvm_unreachable, propagateCallAttrsFromCallee(), Ptr, llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by maybeFreeRetconStorage().
|
inline |
Definition at line 163 of file CoroShape.h.
References assert(), llvm::coro::Async, CoroBegin, and llvm::CoroBeginInst::getId().
Referenced by llvm::coro::AsyncABI::splitCoroutine().
|
inline |
Definition at line 178 of file CoroShape.h.
References getIndexType().
Referenced by markCoroutineAsDone().
|
inline |
Definition at line 173 of file CoroShape.h.
References assert(), FrameTy, llvm::StructType::getElementType(), getSwitchIndexField(), and llvm::coro::Switch.
Referenced by getIndex().
|
inline |
Definition at line 245 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), llvm::coro::getSpillInsertionPt(), and insertSpills().
|
inline |
Definition at line 239 of file CoroShape.h.
References llvm::coro::Shape::SwitchLoweringStorage::PromiseAlloca, llvm::coro::Switch, and SwitchLowering.
Referenced by buildFrameDebugInfo(), and buildFrameType().
|
inline |
Definition at line 225 of file CoroShape.h.
References llvm::coro::Async, llvm::coro::Shape::AsyncLoweringStorage::AsyncCC, AsyncLowering, llvm::CallingConv::Fast, llvm::Function::getCallingConv(), llvm_unreachable, llvm::coro::Shape::RetconLoweringStorage::ResumePrototype, llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by llvm::coro::BaseCloner::create().
|
inline |
Definition at line 188 of file CoroShape.h.
References llvm::coro::Async, FrameTy, llvm::FunctionType::get(), llvm::Type::getContext(), llvm::Function::getFunctionType(), llvm::PointerType::getUnqual(), llvm::Type::getVoidTy(), llvm_unreachable, llvm::coro::Shape::RetconLoweringStorage::ResumePrototype, llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by createCloneDeclaration(), and replaceFallthroughCoroEnd().
|
inline |
Definition at line 158 of file CoroShape.h.
References assert(), CoroBegin, llvm::CoroBeginInst::getId(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Referenced by buildFrameType(), llvm::coro::BaseCloner::create(), and llvm::coro::AnyRetconABI::splitCoroutine().
Definition at line 205 of file CoroShape.h.
References assert(), CoroBegin, llvm::Instruction::getFunction(), llvm::Function::getFunctionType(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Referenced by llvm::coro::AnyRetconABI::init(), and llvm::coro::AnyRetconABI::splitCoroutine().
Definition at line 217 of file CoroShape.h.
References assert(), llvm::Function::getFunctionType(), llvm::FunctionType::params(), llvm::coro::Shape::RetconLoweringStorage::ResumePrototype, llvm::coro::Retcon, RetconLowering, and llvm::coro::RetconOnce.
Referenced by llvm::coro::AnyRetconABI::init().
|
inline |
Definition at line 153 of file CoroShape.h.
References assert(), CoroBegin, llvm::CoroBeginInst::getId(), and llvm::coro::Switch.
Referenced by handleNoSuspendCoroutine(), and llvm::coro::normalizeCoroutine().
|
inline |
Definition at line 168 of file CoroShape.h.
References assert(), FrameTy, llvm::coro::Shape::SwitchLoweringStorage::IndexField, llvm::coro::Switch, and SwitchLowering.
Referenced by getIndexType(), and markCoroutineAsDone().
|
inline |
Definition at line 182 of file CoroShape.h.
References assert(), FrameTy, llvm::StructType::getElementType(), llvm::coro::Shape::SwitchFieldIndex::Resume, and llvm::coro::Switch.
Referenced by llvm::coro::BaseCloner::handleFinalSuspend().
void llvm::coro::Shape::initABI | ( | ) |
void coro::Shape::invalidateCoroutine | ( | Function & | F, |
SmallVectorImpl< CoroFrameInst * > & | CoroFrames | ||
) |
Definition at line 349 of file Coroutines.cpp.
References assert(), llvm::changeToUnreachable(), F, llvm::PointerType::get(), llvm::PoisonValue::get(), and Poison.
Referenced by Shape().
union { ... } llvm::coro::Shape::@452 |
coro::ABI llvm::coro::Shape::ABI |
Definition at line 107 of file CoroShape.h.
Referenced by llvm::coro::BaseCloner::BaseCloner(), llvm::coro::BaseABI::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), llvm::coro::BaseCloner::create(), llvm::coro::SwitchCloner::createClone(), llvm::coro::BaseCloner::createClone(), createCloneDeclaration(), CreateNewABI(), llvm::coro::BaseCloner::deriveNewFramePointer(), doSplitCoroutine(), llvm::coro::BaseCloner::handleFinalSuspend(), handleNoSuspendCoroutine(), llvm::coro::SwitchABI::init(), llvm::coro::AsyncABI::init(), llvm::coro::AnyRetconABI::init(), insertSpills(), markCoroutineAsDone(), maybeFreeRetconStorage(), llvm::coro::normalizeCoroutine(), removeCoroEndsFromRampFunction(), llvm::coro::BaseCloner::replaceCoroSuspends(), llvm::coro::BaseCloner::replaceEntryBlock(), replaceFallthroughCoroEnd(), replaceFrameSizeAndAlignment(), llvm::coro::BaseCloner::replaceRetconOrAsyncSuspendUses(), replaceSwiftErrorOps(), replaceUnwindCoroEnd(), simplifySuspendPoints(), llvm::coro::AsyncABI::splitCoroutine(), llvm::coro::AnyRetconABI::splitCoroutine(), updateAsyncFuncPointerContextSize(), and updateCallGraphAfterCoroutineSplit().
BasicBlock* llvm::coro::Shape::AllocaSpillBlock = nullptr |
Definition at line 113 of file CoroShape.h.
Referenced by clear(), insertSpills(), and llvm::coro::BaseCloner::replaceEntryBlock().
AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 150 of file CoroShape.h.
Referenced by buildFrameType(), llvm::coro::BaseCloner::create(), llvm::coro::BaseCloner::deriveNewFramePointer(), getResumeFunctionCC(), llvm::coro::AsyncABI::splitCoroutine(), and updateAsyncFuncPointerContextSize().
SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 56 of file CoroShape.h.
Referenced by clear(), and replaceFrameSizeAndAlignment().
SmallVector<CoroAwaitSuspendInst *, 4> llvm::coro::Shape::CoroAwaitSuspends |
Definition at line 58 of file CoroShape.h.
Referenced by clear(), and lowerAwaitSuspends().
CoroBeginInst* llvm::coro::Shape::CoroBegin = nullptr |
Definition at line 53 of file CoroShape.h.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame(), clear(), llvm::coro::collectSpillsAndAllocasFromInsts(), llvm::coro::BaseCloner::create(), llvm::coro::SwitchCloner::create(), CreateNewABI(), doSplitCoroutine(), getAsyncCoroId(), getRetconCoroId(), getRetconResultTypes(), llvm::coro::getSpillInsertionPt(), getSwitchCoroId(), handleNoSuspendCoroutine(), llvm::coro::SwitchABI::init(), insertSpills(), llvm::CoroSplitPass::run(), Shape(), simplifySuspendPoints(), llvm::coro::AsyncABI::splitCoroutine(), and llvm::coro::AnyRetconABI::splitCoroutine().
SmallVector<AnyCoroEndInst *, 4> llvm::coro::Shape::CoroEnds |
Definition at line 54 of file CoroShape.h.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame(), clear(), eliminateSwiftErrorArgument(), llvm::coro::normalizeCoroutine(), removeCoroEndsFromRampFunction(), and llvm::coro::BaseCloner::replaceCoroEnds().
SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 55 of file CoroShape.h.
Referenced by clear(), getFrameSizeForShape(), and replaceFrameSizeAndAlignment().
SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 57 of file CoroShape.h.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame(), buildFrameType(), clear(), doSplitCoroutine(), eliminateSwiftErrorArgument(), llvm::coro::SwitchABI::init(), llvm::coro::AnyRetconABI::init(), markCoroutineAsDone(), llvm::coro::normalizeCoroutine(), llvm::coro::BaseCloner::replaceCoroSuspends(), replaceSwiftErrorOps(), llvm::CoroSplitPass::run(), simplifySuspendPoints(), sinkLifetimeStartMarkers(), llvm::coro::AsyncABI::splitCoroutine(), and llvm::coro::AnyRetconABI::splitCoroutine().
Align llvm::coro::Shape::FrameAlign |
Definition at line 110 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), llvm::coro::BaseCloner::create(), handleNoSuspendCoroutine(), replaceFrameSizeAndAlignment(), and llvm::CoroSplitPass::run().
Value* llvm::coro::Shape::FramePtr = nullptr |
Definition at line 112 of file CoroShape.h.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame(), buildFrameDebugInfo(), clear(), llvm::coro::BaseCloner::create(), getInsertPtAfterFramePtr(), insertSpills(), removeCoroEndsFromRampFunction(), llvm::coro::AsyncABI::splitCoroutine(), and llvm::coro::AnyRetconABI::splitCoroutine().
uint64_t llvm::coro::Shape::FrameSize = 0 |
Definition at line 111 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), llvm::coro::BaseCloner::create(), and llvm::CoroSplitPass::run().
StructType* llvm::coro::Shape::FrameTy = nullptr |
Definition at line 109 of file CoroShape.h.
Referenced by llvm::coro::BaseABI::buildCoroutineFrame(), buildFrameDebugInfo(), clear(), llvm::coro::BaseCloner::deriveNewFramePointer(), getFrameSizeForShape(), getIndexType(), getResumeFunctionType(), getSwitchIndexField(), getSwitchResumePointerType(), llvm::coro::BaseCloner::handleFinalSuspend(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), and llvm::coro::AnyRetconABI::splitCoroutine().
RetconLoweringStorage llvm::coro::Shape::RetconLowering |
Definition at line 149 of file CoroShape.h.
Referenced by buildFrameType(), llvm::coro::BaseCloner::create(), llvm::coro::BaseCloner::deriveNewFramePointer(), getResumeFunctionCC(), getResumeFunctionType(), getRetconResumeTypes(), llvm::coro::AnyRetconABI::init(), maybeFreeRetconStorage(), and llvm::coro::AnyRetconABI::splitCoroutine().
SmallVector<CallInst *, 2> llvm::coro::Shape::SwiftErrorOps |
Definition at line 62 of file CoroShape.h.
Referenced by clear(), emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 148 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), llvm::coro::BaseCloner::create(), getPromiseAlloca(), getSwitchIndexField(), llvm::coro::BaseCloner::handleFinalSuspend(), insertSpills(), markCoroutineAsDone(), llvm::coro::normalizeCoroutine(), llvm::coro::BaseCloner::replaceEntryBlock(), and simplifySuspendPoints().
SmallVector<CallInst *, 2> llvm::coro::Shape::SymmetricTransfers |
Definition at line 59 of file CoroShape.h.
Referenced by clear(), llvm::coro::BaseCloner::create(), and lowerAwaitSuspend().