LLVM 20.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 |
BasicBlock::iterator | 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 |
SmallVector< CoroAwaitSuspendInst *, 4 > | CoroAwaitSuspends |
SmallVector< CallInst *, 2 > | SymmetricTransfers |
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 80 of file CoroInternal.h.
|
default |
Definition at line 269 of file CoroInternal.h.
References F.
void coro::Shape::buildFrom | ( | Function & | F | ) |
Definition at line 171 of file Coroutines.cpp.
References llvm::coro::Async, llvm::changeToUnreachable(), clear(), createCoroSave(), llvm::Type::dump(), F, llvm::PointerType::get(), llvm::UndefValue::get(), I, II, 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, 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 456 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 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 479 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 lowerNonLocalAlloca(), and maybeFreeRetconStorage().
|
inline |
Definition at line 165 of file CoroInternal.h.
References assert(), and llvm::CoroBeginInst::getId().
|
inline |
Definition at line 180 of file CoroInternal.h.
Referenced by markCoroutineAsDone().
|
inline |
Definition at line 175 of file CoroInternal.h.
References assert(), and llvm::StructType::getElementType().
|
inline |
Definition at line 249 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), and insertSpills().
|
inline |
Definition at line 243 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), and buildFrameType().
|
inline |
Definition at line 229 of file CoroInternal.h.
References llvm_unreachable.
|
inline |
Definition at line 190 of file CoroInternal.h.
References llvm::Type::getContext(), and llvm_unreachable.
Referenced by createCloneDeclaration(), and replaceFallthroughCoroEnd().
|
inline |
Definition at line 159 of file CoroInternal.h.
References assert(), and llvm::CoroBeginInst::getId().
Referenced by buildFrameType().
Definition at line 207 of file CoroInternal.h.
References assert(), llvm::Instruction::getFunction(), and llvm::Function::getFunctionType().
Referenced by splitRetconCoroutine().
Definition at line 220 of file CoroInternal.h.
References assert().
|
inline |
Definition at line 154 of file CoroInternal.h.
References assert(), and llvm::CoroBeginInst::getId().
Referenced by llvm::coro::buildCoroutineFrame().
|
inline |
Definition at line 170 of file CoroInternal.h.
References assert().
Referenced by markCoroutineAsDone().
|
inline |
Definition at line 184 of file CoroInternal.h.
References assert(), and llvm::StructType::getElementType().
union { ... } llvm::coro::Shape::@669 |
coro::ABI llvm::coro::Shape::ABI |
Definition at line 105 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), collectFrameAlloca(), createCloneDeclaration(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), maybeFreeRetconStorage(), removeCoroEndsFromRampFunction(), replaceFallthroughCoroEnd(), replaceFrameSizeAndAlignment(), replaceSwiftErrorOps(), replaceUnwindCoroEnd(), simplifySuspendPoints(), splitAsyncCoroutine(), splitCoroutine(), splitRetconCoroutine(), updateAsyncFuncPointerContextSize(), and updateCallGraphAfterCoroutineSplit().
BasicBlock* llvm::coro::Shape::AllocaSpillBlock |
Definition at line 111 of file CoroInternal.h.
Referenced by clear(), and insertSpills().
AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 151 of file CoroInternal.h.
Referenced by buildFrameType(), splitAsyncCoroutine(), and updateAsyncFuncPointerContextSize().
SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 84 of file CoroInternal.h.
Referenced by replaceFrameSizeAndAlignment().
SmallVector<CoroAwaitSuspendInst *, 4> llvm::coro::Shape::CoroAwaitSuspends |
Definition at line 87 of file CoroInternal.h.
Referenced by lowerAwaitSuspends().
CoroBeginInst* llvm::coro::Shape::CoroBegin |
Definition at line 81 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), clear(), handleNoSuspendCoroutine(), insertSpills(), simplifySuspendPoints(), splitAsyncCoroutine(), splitCoroutine(), and splitRetconCoroutine().
SmallVector<AnyCoroEndInst *, 4> llvm::coro::Shape::CoroEnds |
Definition at line 82 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), clear(), eliminateSwiftErrorArgument(), and removeCoroEndsFromRampFunction().
SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 83 of file CoroInternal.h.
Referenced by clear(), and replaceFrameSizeAndAlignment().
SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 85 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameType(), clear(), collectFrameAlloca(), eliminateSwiftErrorArgument(), markCoroutineAsDone(), replaceSwiftErrorOps(), simplifySuspendPoints(), sinkLifetimeStartMarkers(), splitAsyncCoroutine(), splitCoroutine(), and splitRetconCoroutine().
Align llvm::coro::Shape::FrameAlign |
Definition at line 108 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), buildFrameType(), handleNoSuspendCoroutine(), and replaceFrameSizeAndAlignment().
Value* llvm::coro::Shape::FramePtr |
Definition at line 110 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), clear(), insertSpills(), removeCoroEndsFromRampFunction(), splitAsyncCoroutine(), and splitRetconCoroutine().
uint64_t llvm::coro::Shape::FrameSize |
Definition at line 109 of file CoroInternal.h.
Referenced by buildFrameDebugInfo(), and buildFrameType().
StructType* llvm::coro::Shape::FrameTy |
Definition at line 107 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), clear(), handleNoSuspendCoroutine(), insertSpills(), markCoroutineAsDone(), replaceFrameSizeAndAlignment(), and splitRetconCoroutine().
bool llvm::coro::Shape::OptimizeFrame |
This would only be true if optimization are enabled.
Definition at line 114 of file CoroInternal.h.
Referenced by insertSpills(), and splitCoroutine().
RetconLoweringStorage llvm::coro::Shape::RetconLowering |
Definition at line 150 of file CoroInternal.h.
Referenced by buildFrameType(), maybeFreeRetconStorage(), and splitRetconCoroutine().
SmallVector<CallInst*, 2> llvm::coro::Shape::SwiftErrorOps |
Definition at line 86 of file CoroInternal.h.
Referenced by emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 149 of file CoroInternal.h.
Referenced by llvm::coro::buildCoroutineFrame(), buildFrameDebugInfo(), buildFrameType(), collectFrameAlloca(), insertSpills(), markCoroutineAsDone(), and simplifySuspendPoints().
SmallVector<CallInst *, 2> llvm::coro::Shape::SymmetricTransfers |
Definition at line 88 of file CoroInternal.h.
Referenced by lowerAwaitSuspend().