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. | |
void | emitDealloc (IRBuilder<> &Builder, Value *Ptr, CallGraph *CG) const |
Deallocate memory according to the rules of the active lowering. | |
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. | |
union { | |
SwitchLoweringStorage SwitchLowering | |
RetconLoweringStorage RetconLowering | |
AsyncLoweringStorage AsyncLowering | |
}; | |
Definition at line 76 of file CoroInternal.h.
|
default |
Definition at line 259 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, instructions, llvm::CastInst::isBitCastable(), llvm::Type::isVoidTy(), llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), llvm::coro::Retcon, llvm::coro::RetconOnce, SI, llvm::ArrayRef< T >::size(), std::swap(), and llvm::coro::Switch.
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::Alloc, llvm::coro::Async, Builder, llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, llvm::coro::RetconOnce, Size, and llvm::coro::Switch.
Referenced by lowerNonLocalAlloca(), and 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 lowerNonLocalAlloca(), and maybeFreeRetconStorage().
|
inline |
Definition at line 159 of file CoroInternal.h.
References assert(), and llvm::CoroBeginInst::getId().
|
inline |
Definition at line 174 of file CoroInternal.h.
Referenced by createResumeEntryBlock().
|
inline |
Definition at line 169 of file CoroInternal.h.
References assert(), and llvm::StructType::getElementType().
Referenced by createResumeEntryBlock().
|
inline |
Definition at line 242 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), insertSpills(), and updateCoroFrame().
|
inline |
Definition at line 236 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), and buildFrameType().
|
inline |
Definition at line 222 of file CoroInternal.h.
References llvm_unreachable.
|
inline |
Definition at line 184 of file CoroInternal.h.
References llvm::Type::getContext(), llvm::Type::getPointerTo(), and llvm_unreachable.
Referenced by createCloneDeclaration(), and replaceFallthroughCoroEnd().
|
inline |
Definition at line 153 of file CoroInternal.h.
References assert(), and llvm::CoroBeginInst::getId().
Referenced by buildFrameType().
Definition at line 200 of file CoroInternal.h.
References assert(), llvm::Instruction::getFunction(), and llvm::Function::getFunctionType().
Referenced by splitRetconCoroutine().
Definition at line 213 of file CoroInternal.h.
References assert().
|
inline |
Definition at line 148 of file CoroInternal.h.
References assert(), and llvm::CoroBeginInst::getId().
Referenced by llvm::coro::buildCoroutineFrame(), setCoroInfo(), and updateCoroFrame().
|
inline |
Definition at line 164 of file CoroInternal.h.
References assert().
Referenced by createResumeEntryBlock().
|
inline |
Definition at line 178 of file CoroInternal.h.
References assert(), and llvm::StructType::getElementType().
union { ... } llvm::coro::Shape::@627 |
coro::ABI llvm::coro::Shape::ABI |
Definition at line 99 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), collectFrameAlloca(), createCloneDeclaration(), createResumeEntryBlock(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), maybeFreeRetconStorage(), replaceFallthroughCoroEnd(), replaceFrameSizeAndAlignment(), replaceSwiftErrorOps(), replaceUnwindCoroEnd(), setCoroInfo(), simplifySuspendPoints(), splitAsyncCoroutine(), splitCoroutine(), splitRetconCoroutine(), splitSwitchCoroutine(), updateAsyncFuncPointerContextSize(), updateCallGraphAfterCoroutineSplit(), and updateCoroFrame().
BasicBlock* llvm::coro::Shape::AllocaSpillBlock |
Definition at line 105 of file CoroInternal.h.
Referenced by clear(), and insertSpills().
AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 145 of file CoroInternal.h.
Referenced by buildFrameType(), splitAsyncCoroutine(), and updateAsyncFuncPointerContextSize().
SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 80 of file CoroInternal.h.
Referenced by replaceFrameSizeAndAlignment().
CoroBeginInst* llvm::coro::Shape::CoroBegin |
Definition at line 77 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 78 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), clear(), eliminateSwiftErrorArgument(), removeCoroEnds(), and updateCallGraphAfterCoroutineSplit().
SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 79 of file CoroInternal.h.
Referenced by clear(), and replaceFrameSizeAndAlignment().
SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 81 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameType(), clear(), collectFrameAlloca(), createResumeEntryBlock(), eliminateSwiftErrorArgument(), replaceSwiftErrorOps(), simplifySuspendPoints(), sinkLifetimeStartMarkers(), splitAsyncCoroutine(), splitCoroutine(), and splitRetconCoroutine().
Align llvm::coro::Shape::FrameAlign |
Definition at line 102 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), handleNoSuspendCoroutine(), and replaceFrameSizeAndAlignment().
Value* llvm::coro::Shape::FramePtr |
Definition at line 104 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), clear(), createFramePtr(), createResumeEntryBlock(), insertSpills(), removeCoroEnds(), splitAsyncCoroutine(), splitRetconCoroutine(), and updateCoroFrame().
uint64_t llvm::coro::Shape::FrameSize |
Definition at line 103 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), and buildFrameType().
StructType* llvm::coro::Shape::FrameTy |
Definition at line 101 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), 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 108 of file CoroInternal.h.
Referenced by insertSpills(), and splitCoroutine().
RetconLoweringStorage llvm::coro::Shape::RetconLowering |
Definition at line 144 of file CoroInternal.h.
Referenced by buildFrameType(), maybeFreeRetconStorage(), and splitRetconCoroutine().
SmallVector<CallInst*, 2> llvm::coro::Shape::SwiftErrorOps |
Definition at line 82 of file CoroInternal.h.
Referenced by emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 143 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), collectFrameAlloca(), createResumeEntryBlock(), insertSpills(), and simplifySuspendPoints().