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< 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 272 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 181 of file Coroutines.cpp.
References ABI, assert(), llvm::coro::Async, AsyncLowering, llvm::cast(), clear(), CoroAligns, CoroAwaitSuspends, CoroBegin, CoroEnds, 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 472 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 65 of file CoroShape.h.
References AllocaSpillBlock, CoroAligns, CoroAwaitSuspends, CoroBegin, CoroEnds, 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 505 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 528 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 168 of file CoroShape.h.
References ABI, assert(), llvm::coro::Async, llvm::cast(), and CoroBegin.
Referenced by analyze().
|
inline |
Definition at line 183 of file CoroShape.h.
References getIndexType().
Referenced by markCoroutineAsDone().
|
inline |
Definition at line 178 of file CoroShape.h.
References ABI, assert(), llvm::cast(), FrameTy, getSwitchIndexField(), and llvm::coro::Switch.
Referenced by getIndex().
|
inline |
Definition at line 250 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 244 of file CoroShape.h.
References ABI, llvm::coro::Switch, and SwitchLowering.
Referenced by buildFrameType(), and cleanCoroutine().
|
inline |
Definition at line 230 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 193 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 163 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 210 of file CoroShape.h.
References ABI, llvm::ArrayRef(), assert(), CoroBegin, llvm::dyn_cast(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Definition at line 222 of file CoroShape.h.
References ABI, assert(), llvm::coro::Retcon, RetconLowering, and llvm::coro::RetconOnce.
|
inline |
Definition at line 158 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 173 of file CoroShape.h.
References ABI, assert(), FrameTy, llvm::coro::Switch, and SwitchLowering.
Referenced by getIndexType(), and markCoroutineAsDone().
|
inline |
Definition at line 187 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 342 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 112 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 118 of file CoroShape.h.
Referenced by clear(), and insertSpills().
AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 155 of file CoroShape.h.
Referenced by analyze(), buildFrameType(), getResumeFunctionCC(), and updateAsyncFuncPointerContextSize().
SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 57 of file CoroShape.h.
Referenced by analyze(), clear(), and replaceFrameSizeAndAlignment().
SmallVector<CoroAwaitSuspendInst *, 4> llvm::coro::Shape::CoroAwaitSuspends |
Definition at line 59 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<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 56 of file CoroShape.h.
Referenced by analyze(), clear(), getFrameSizeForShape(), and replaceFrameSizeAndAlignment().
SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 58 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 115 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), handleNoSuspendCoroutine(), replaceFrameSizeAndAlignment(), and llvm::CoroSplitPass::run().
Value* llvm::coro::Shape::FramePtr = nullptr |
Definition at line 117 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), clear(), getInsertPtAfterFramePtr(), insertSpills(), and removeCoroEndsFromRampFunction().
uint64_t llvm::coro::Shape::FrameSize = 0 |
Definition at line 116 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), and llvm::CoroSplitPass::run().
StructType* llvm::coro::Shape::FrameTy = nullptr |
Definition at line 114 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 154 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 63 of file CoroShape.h.
Referenced by clear(), emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 153 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 60 of file CoroShape.h.
Referenced by clear(), and lowerAwaitSuspend().