LLVM 22.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< CoroIsInRampInst *, 2 > | CoroIsInRampInsts |
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 53 of file CoroShape.h.
|
default |
Referenced by doSplitCoroutine().
|
inlineexplicit |
Definition at line 274 of file CoroShape.h.
References analyze(), cleanCoroutine(), CoroBegin, F, and invalidateCoroutine().
void coro::Shape::analyze | ( | Function & | F, |
SmallVectorImpl< CoroFrameInst * > & | CoroFrames, | ||
SmallVectorImpl< CoroSaveInst * > & | UnusedCoroSaves, | ||
CoroPromiseInst *& | CoroPromise ) |
Definition at line 182 of file Coroutines.cpp.
References ABI, assert(), llvm::coro::Async, AsyncLowering, llvm::cast(), clear(), CoroAligns, CoroAwaitSuspends, CoroBegin, CoroEnds, CoroIsInRampInsts, CoroSizes, CoroSuspends, llvm::dyn_cast(), F, getAsyncCoroId(), getRetconCoroId(), getSwitchCoroId(), I, II, instructions, llvm::isa(), llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, std::swap(), llvm::coro::Switch, and SwitchLowering.
Referenced by Shape().
void coro::Shape::cleanCoroutine | ( | SmallVectorImpl< CoroFrameInst * > & | CoroFrames, |
SmallVectorImpl< CoroSaveInst * > & | UnusedCoroSaves, | ||
CoroPromiseInst * | CoroPromise ) |
Definition at line 476 of file Coroutines.cpp.
References llvm::cast(), llvm::SmallVectorImpl< T >::clear(), CoroBegin, llvm::Instruction::eraseFromParent(), getPromiseAlloca(), llvm::CoroPromiseInst::isFromPromise(), and llvm::Value::replaceAllUsesWith().
Referenced by Shape().
|
inline |
Definition at line 66 of file CoroShape.h.
References AllocaSpillBlock, CoroAligns, CoroAwaitSuspends, CoroBegin, CoroEnds, CoroIsInRampInsts, CoroSizes, CoroSuspends, FramePtr, FrameTy, SwiftErrorOps, and SymmetricTransfers.
Referenced by analyze().
Allocate memory according to the rules of the active lowering.
CG | - if non-null, will be updated for the new call |
Definition at line 509 of file Coroutines.cpp.
References ABI, addCallToCallGraph(), llvm::Alloc, llvm::coro::Async, Call, llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, Size, and llvm::coro::Switch.
Deallocate memory according to the rules of the active lowering.
CG | - if non-null, will be updated for the new call |
Definition at line 532 of file Coroutines.cpp.
References ABI, addCallToCallGraph(), llvm::coro::Async, Call, llvm_unreachable, propagateCallAttrsFromCallee(), Ptr, llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by maybeFreeRetconStorage().
|
inline |
Definition at line 170 of file CoroShape.h.
References ABI, assert(), llvm::coro::Async, llvm::cast(), and CoroBegin.
Referenced by analyze().
|
inline |
Definition at line 185 of file CoroShape.h.
References getIndexType().
Referenced by markCoroutineAsDone().
|
inline |
Definition at line 180 of file CoroShape.h.
References ABI, assert(), llvm::cast(), FrameTy, getSwitchIndexField(), and llvm::coro::Switch.
Referenced by getIndex().
|
inline |
Definition at line 252 of file CoroShape.h.
References llvm::cast(), llvm::dyn_cast(), FramePtr, and I.
Referenced by buildFrameDebugInfo(), llvm::coro::getSpillInsertionPt(), and insertSpills().
|
inline |
Definition at line 246 of file CoroShape.h.
References ABI, llvm::coro::Switch, and SwitchLowering.
Referenced by buildFrameType(), and cleanCoroutine().
|
inline |
Definition at line 232 of file CoroShape.h.
References ABI, llvm::coro::Async, AsyncLowering, llvm::CallingConv::Fast, llvm_unreachable, llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
|
inline |
Definition at line 195 of file CoroShape.h.
References ABI, llvm::coro::Async, FrameTy, llvm::FunctionType::get(), llvm::PointerType::getUnqual(), llvm::Type::getVoidTy(), llvm_unreachable, llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by createCloneDeclaration(), and replaceFallthroughCoroEnd().
|
inline |
Definition at line 165 of file CoroShape.h.
References ABI, assert(), llvm::cast(), CoroBegin, llvm::coro::Retcon, and llvm::coro::RetconOnce.
Referenced by analyze(), and buildFrameType().
Definition at line 212 of file CoroShape.h.
References ABI, llvm::ArrayRef(), assert(), CoroBegin, llvm::dyn_cast(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Definition at line 224 of file CoroShape.h.
References ABI, assert(), llvm::coro::Retcon, RetconLowering, and llvm::coro::RetconOnce.
|
inline |
Definition at line 160 of file CoroShape.h.
References ABI, assert(), llvm::cast(), CoroBegin, and llvm::coro::Switch.
Referenced by analyze(), handleNoSuspendCoroutine(), and llvm::coro::normalizeCoroutine().
|
inline |
Definition at line 175 of file CoroShape.h.
References ABI, assert(), FrameTy, llvm::coro::Switch, and SwitchLowering.
Referenced by getIndexType(), and markCoroutineAsDone().
|
inline |
Definition at line 189 of file CoroShape.h.
References ABI, assert(), llvm::cast(), FrameTy, llvm::coro::Shape::SwitchFieldIndex::Resume, and llvm::coro::Switch.
void coro::Shape::invalidateCoroutine | ( | Function & | F, |
SmallVectorImpl< CoroFrameInst * > & | CoroFrames ) |
Definition at line 346 of file Coroutines.cpp.
References assert(), llvm::changeToUnreachable(), CoroBegin, CoroEnds, CoroSuspends, F, llvm::PointerType::get(), llvm::PoisonValue::get(), and Poison.
Referenced by Shape().
union { ... } llvm::coro::Shape |
coro::ABI llvm::coro::Shape::ABI |
Definition at line 114 of file CoroShape.h.
Referenced by analyze(), buildFrameDebugInfo(), buildFrameType(), createCloneDeclaration(), CreateNewABI(), doSplitCoroutine(), emitAlloc(), emitDealloc(), getAsyncCoroId(), getIndexType(), getPromiseAlloca(), getResumeFunctionCC(), getResumeFunctionType(), getRetconCoroId(), getRetconResultTypes(), getRetconResumeTypes(), getSwitchCoroId(), getSwitchIndexField(), getSwitchResumePointerType(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), maybeFreeRetconStorage(), llvm::coro::normalizeCoroutine(), removeCoroEndsFromRampFunction(), replaceFallthroughCoroEnd(), replaceFrameSizeAndAlignment(), replaceSwiftErrorOps(), replaceUnwindCoroEnd(), llvm::CoroSplitPass::run(), simplifySuspendPoints(), updateAsyncFuncPointerContextSize(), and updateCallGraphAfterCoroutineSplit().
BasicBlock* llvm::coro::Shape::AllocaSpillBlock = nullptr |
Definition at line 120 of file CoroShape.h.
Referenced by clear(), and insertSpills().
AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 157 of file CoroShape.h.
Referenced by analyze(), buildFrameType(), getResumeFunctionCC(), and updateAsyncFuncPointerContextSize().
SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 58 of file CoroShape.h.
Referenced by analyze(), clear(), and replaceFrameSizeAndAlignment().
SmallVector<CoroAwaitSuspendInst *, 4> llvm::coro::Shape::CoroAwaitSuspends |
Definition at line 60 of file CoroShape.h.
Referenced by analyze(), clear(), and lowerAwaitSuspends().
CoroBeginInst* llvm::coro::Shape::CoroBegin = nullptr |
Definition at line 54 of file CoroShape.h.
Referenced by analyze(), cleanCoroutine(), clear(), llvm::coro::collectSpillsAndAllocasFromInsts(), CreateNewABI(), doSplitCoroutine(), getAsyncCoroId(), getRetconCoroId(), getRetconResultTypes(), llvm::coro::getSpillInsertionPt(), getSwitchCoroId(), handleNoSuspendCoroutine(), insertSpills(), invalidateCoroutine(), llvm::CoroSplitPass::run(), Shape(), and simplifySuspendPoints().
SmallVector<AnyCoroEndInst *, 4> llvm::coro::Shape::CoroEnds |
Definition at line 55 of file CoroShape.h.
Referenced by analyze(), clear(), eliminateSwiftErrorArgument(), invalidateCoroutine(), llvm::coro::normalizeCoroutine(), and removeCoroEndsFromRampFunction().
SmallVector<CoroIsInRampInst *, 2> llvm::coro::Shape::CoroIsInRampInsts |
Definition at line 56 of file CoroShape.h.
Referenced by analyze(), clear(), and removeCoroIsInRampFromRampFunction().
SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 57 of file CoroShape.h.
Referenced by analyze(), clear(), getFrameSizeForShape(), and replaceFrameSizeAndAlignment().
SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 59 of file CoroShape.h.
Referenced by analyze(), buildFrameType(), clear(), doSplitCoroutine(), eliminateSwiftErrorArgument(), invalidateCoroutine(), markCoroutineAsDone(), llvm::coro::normalizeCoroutine(), replaceSwiftErrorOps(), llvm::CoroSplitPass::run(), simplifySuspendPoints(), and sinkLifetimeStartMarkers().
Align llvm::coro::Shape::FrameAlign |
Definition at line 117 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), handleNoSuspendCoroutine(), replaceFrameSizeAndAlignment(), and llvm::CoroSplitPass::run().
Value* llvm::coro::Shape::FramePtr = nullptr |
Definition at line 119 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), clear(), getInsertPtAfterFramePtr(), insertSpills(), and removeCoroEndsFromRampFunction().
uint64_t llvm::coro::Shape::FrameSize = 0 |
Definition at line 118 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), and llvm::CoroSplitPass::run().
StructType* llvm::coro::Shape::FrameTy = nullptr |
Definition at line 116 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), clear(), getFrameSizeForShape(), getIndexType(), getResumeFunctionType(), getSwitchIndexField(), getSwitchResumePointerType(), handleNoSuspendCoroutine(), insertSpills(), and markCoroutineAsDone().
RetconLoweringStorage llvm::coro::Shape::RetconLowering |
Definition at line 156 of file CoroShape.h.
Referenced by analyze(), buildFrameType(), emitAlloc(), emitDealloc(), getResumeFunctionCC(), getResumeFunctionType(), getRetconResumeTypes(), and maybeFreeRetconStorage().
SmallVector<CallInst *, 2> llvm::coro::Shape::SwiftErrorOps |
Definition at line 64 of file CoroShape.h.
Referenced by clear(), emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 155 of file CoroShape.h.
Referenced by analyze(), buildFrameDebugInfo(), buildFrameType(), getPromiseAlloca(), getSwitchIndexField(), insertSpills(), markCoroutineAsDone(), llvm::coro::normalizeCoroutine(), and simplifySuspendPoints().
SmallVector<CallInst *, 2> llvm::coro::Shape::SymmetricTransfers |
Definition at line 61 of file CoroShape.h.
Referenced by clear(), and lowerAwaitSuspend().