LLVM
17.0.0git
|
#include "Transforms/Coroutines/CoroInternal.h"
Classes | |
struct | AsyncLoweringStorage |
struct | RetconLoweringStorage |
struct | SwitchFieldIndex |
struct | SwitchLoweringStorage |
Public Member Functions | |
CoroIdInst * | getSwitchCoroId () const |
AnyCoroIdRetconInst * | getRetconCoroId () const |
CoroIdAsyncInst * | getAsyncCoroId () const |
unsigned | getSwitchIndexField () const |
IntegerType * | getIndexType () const |
ConstantInt * | getIndex (uint64_t Value) const |
PointerType * | getSwitchResumePointerType () const |
FunctionType * | getResumeFunctionType () const |
ArrayRef< Type * > | getRetconResultTypes () const |
ArrayRef< Type * > | getRetconResumeTypes () const |
CallingConv::ID | getResumeFunctionCC () const |
AllocaInst * | getPromiseAlloca () const |
Instruction * | getInsertPtAfterFramePtr () const |
Value * | emitAlloc (IRBuilder<> &Builder, Value *Size, CallGraph *CG) const |
Allocate memory according to the rules of the active lowering. More... | |
void | emitDealloc (IRBuilder<> &Builder, Value *Ptr, CallGraph *CG) const |
Deallocate memory according to the rules of the active lowering. More... | |
Shape ()=default | |
Shape (Function &F, bool OptimizeFrame=false) | |
void | buildFrom (Function &F) |
Public Attributes | |
CoroBeginInst * | CoroBegin |
SmallVector< AnyCoroEndInst *, 4 > | CoroEnds |
SmallVector< CoroSizeInst *, 2 > | CoroSizes |
SmallVector< CoroAlignInst *, 2 > | CoroAligns |
SmallVector< AnyCoroSuspendInst *, 4 > | CoroSuspends |
SmallVector< CallInst *, 2 > | SwiftErrorOps |
coro::ABI | ABI |
StructType * | FrameTy |
Align | FrameAlign |
uint64_t | FrameSize |
Value * | FramePtr |
BasicBlock * | AllocaSpillBlock |
bool | OptimizeFrame |
This would only be true if optimization are enabled. More... | |
union { | |
SwitchLoweringStorage SwitchLowering | |
RetconLoweringStorage RetconLowering | |
AsyncLoweringStorage AsyncLowering | |
}; | |
Definition at line 73 of file CoroInternal.h.
|
default |
Definition at line 257 of file CoroInternal.h.
References F.
void coro::Shape::buildFrom | ( | Function & | F | ) |
Definition at line 172 of file Coroutines.cpp.
References llvm::coro::Async, llvm::changeToUnreachable(), clear(), createCoroSave(), llvm::Type::dump(), E, F, llvm::UndefValue::get(), llvm::Type::getInt8PtrTy(), I, llvm::instructions(), llvm::CastInst::isBitCastable(), llvm::Type::isVoidTy(), llvm_unreachable, llvm::NVPTXISD::Prototype, llvm::report_fatal_error(), llvm::coro::Retcon, llvm::coro::RetconOnce, SI, llvm::ArrayRef< T >::size(), std::swap(), llvm::coro::Switch, and llvm::RegState::Undef.
Allocate memory according to the rules of the active lowering.
CG | - if non-null, will be updated for the new call |
Definition at line 453 of file Coroutines.cpp.
References addCallToCallGraph(), llvm::coro::Async, Builder, llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by splitRetconCoroutine().
Deallocate memory according to the rules of the active lowering.
CG | - if non-null, will be updated for the new call |
Definition at line 476 of file Coroutines.cpp.
References addCallToCallGraph(), llvm::coro::Async, Builder, llvm_unreachable, propagateCallAttrsFromCallee(), Ptr, llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by maybeFreeRetconStorage().
|
inline |
Definition at line 157 of file CoroInternal.h.
References assert(), llvm::coro::Async, and llvm::CoroBeginInst::getId().
|
inline |
Definition at line 172 of file CoroInternal.h.
References llvm::ConstantInt::get().
Referenced by createResumeEntryBlock().
|
inline |
Definition at line 167 of file CoroInternal.h.
References assert(), llvm::StructType::getElementType(), and llvm::coro::Switch.
Referenced by createResumeEntryBlock().
|
inline |
Definition at line 240 of file CoroInternal.h.
References I.
Referenced by buildFrameDebugInfo(), insertSpills(), and updateCoroFrame().
|
inline |
Definition at line 234 of file CoroInternal.h.
References llvm::coro::Switch.
Referenced by buildFrameDebugInfo(), and buildFrameType().
|
inline |
Definition at line 220 of file CoroInternal.h.
References llvm::coro::Async, llvm::CallingConv::Fast, llvm_unreachable, llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.
|
inline |
Definition at line 182 of file CoroInternal.h.
References llvm::coro::Async, llvm::FunctionType::get(), llvm::Type::getContext(), llvm::Type::getPointerTo(), llvm::Type::getVoidTy(), llvm_unreachable, llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by createCloneDeclaration().
|
inline |
Definition at line 151 of file CoroInternal.h.
References assert(), llvm::CoroBeginInst::getId(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Referenced by buildFrameType().
Definition at line 198 of file CoroInternal.h.
References assert(), llvm::Instruction::getFunction(), llvm::Function::getFunctionType(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Referenced by splitRetconCoroutine().
Definition at line 211 of file CoroInternal.h.
References assert(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
|
inline |
Definition at line 146 of file CoroInternal.h.
References assert(), llvm::CoroBeginInst::getId(), and llvm::coro::Switch.
Referenced by llvm::coro::buildCoroutineFrame(), setCoroInfo(), and updateCoroFrame().
|
inline |
Definition at line 162 of file CoroInternal.h.
References assert(), and llvm::coro::Switch.
Referenced by createResumeEntryBlock().
|
inline |
Definition at line 176 of file CoroInternal.h.
References assert(), llvm::StructType::getElementType(), and llvm::coro::Switch.
union { ... } |
coro::ABI llvm::coro::Shape::ABI |
Definition at line 96 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), collectFrameAlloca(), createCloneDeclaration(), createResumeEntryBlock(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), maybeFreeRetconStorage(), replaceFrameSizeAndAlignment(), replaceSwiftErrorOps(), setCoroInfo(), simplifySuspendPoints(), splitAsyncCoroutine(), splitCoroutine(), splitRetconCoroutine(), splitSwitchCoroutine(), updateAsyncFuncPointerContextSize(), updateCallGraphAfterCoroutineSplit(), and updateCoroFrame().
BasicBlock* llvm::coro::Shape::AllocaSpillBlock |
Definition at line 102 of file CoroInternal.h.
Referenced by clear(), and insertSpills().
AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 143 of file CoroInternal.h.
Referenced by buildFrameType(), splitAsyncCoroutine(), and updateAsyncFuncPointerContextSize().
SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 77 of file CoroInternal.h.
Referenced by replaceFrameSizeAndAlignment().
CoroBeginInst* llvm::coro::Shape::CoroBegin |
Definition at line 74 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), clear(), collectFrameAlloca(), createFramePtr(), handleNoSuspendCoroutine(), insertSpills(), simplifySuspendPoints(), splitAsyncCoroutine(), splitCoroutine(), splitRetconCoroutine(), and updateCallGraphAfterCoroutineSplit().
SmallVector<AnyCoroEndInst *, 4> llvm::coro::Shape::CoroEnds |
Definition at line 75 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), and clear().
SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 76 of file CoroInternal.h.
Referenced by clear(), and replaceFrameSizeAndAlignment().
SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 78 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameType(), clear(), collectFrameAlloca(), createResumeEntryBlock(), eliminateSwiftErrorArgument(), replaceSwiftErrorOps(), llvm::CoroSplitPass::run(), simplifySuspendPoints(), sinkLifetimeStartMarkers(), splitAsyncCoroutine(), splitCoroutine(), and splitRetconCoroutine().
Align llvm::coro::Shape::FrameAlign |
Definition at line 99 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), handleNoSuspendCoroutine(), and replaceFrameSizeAndAlignment().
Value* llvm::coro::Shape::FramePtr |
Definition at line 101 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), clear(), createFramePtr(), createResumeEntryBlock(), insertSpills(), splitAsyncCoroutine(), splitRetconCoroutine(), and updateCoroFrame().
uint64_t llvm::coro::Shape::FrameSize |
Definition at line 100 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), and buildFrameType().
StructType* llvm::coro::Shape::FrameTy |
Definition at line 98 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), clear(), createFramePtr(), createResumeEntryBlock(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), replaceFrameSizeAndAlignment(), splitRetconCoroutine(), and updateCoroFrame().
bool llvm::coro::Shape::OptimizeFrame |
This would only be true if optimization are enabled.
Definition at line 105 of file CoroInternal.h.
Referenced by insertSpills(), and splitCoroutine().
RetconLoweringStorage llvm::coro::Shape::RetconLowering |
Definition at line 142 of file CoroInternal.h.
Referenced by buildFrameType(), maybeFreeRetconStorage(), and splitRetconCoroutine().
SmallVector<CallInst*, 2> llvm::coro::Shape::SwiftErrorOps |
Definition at line 79 of file CoroInternal.h.
Referenced by emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 141 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), collectFrameAlloca(), createResumeEntryBlock(), insertSpills(), and simplifySuspendPoints().