|
LLVM 24.0.0git
|
#include "llvm/Transforms/Coroutines/CoroShape.h"
Classes | |
| struct | AsyncLoweringStorage |
| struct | RetconLoweringStorage |
| 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 |
| SmallDenseMap< AnyCoroSuspendInst *, uint64_t, 4 > | SuspendFreqs |
| std::optional< uint64_t > | ResumeEntryCount |
| SmallVector< CoroAwaitSuspendInst *, 4 > | CoroAwaitSuspends |
| SmallVector< CallInst *, 2 > | SymmetricTransfers |
| SmallVector< CallInst *, 2 > | SwiftErrorOps |
| coro::ABI | ABI |
| Align | FrameAlign |
| uint64_t | FrameSize = 0 |
| Value * | FramePtr = nullptr |
| BasicBlock * | AllocaSpillBlock = nullptr |
| union { | |
| SwitchLoweringStorage SwitchLowering | |
| RetconLoweringStorage RetconLowering | |
| AsyncLoweringStorage AsyncLowering | |
| }; | |
Definition at line 54 of file CoroShape.h.
|
default |
Referenced by doSplitCoroutine().
|
inlineexplicit |
Definition at line 265 of file CoroShape.h.
References analyze(), cleanCoroutine(), CoroBegin, F, and invalidateCoroutine().
| void coro::Shape::analyze | ( | Function & | F, |
| SmallVectorImpl< CoroFrameInst * > & | CoroFrames, | ||
| SmallVectorImpl< CoroSaveInst * > & | UnusedCoroSaves ) |
Definition at line 183 of file Coroutines.cpp.
References ABI, 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 ) |
Definition at line 472 of file Coroutines.cpp.
References llvm::SmallVectorImpl< T >::clear(), and CoroBegin.
Referenced by Shape().
|
inline |
Definition at line 72 of file CoroShape.h.
References AllocaSpillBlock, CoroAligns, CoroAwaitSuspends, CoroBegin, CoroEnds, CoroIsInRampInsts, CoroSizes, CoroSuspends, FramePtr, ResumeEntryCount, SuspendFreqs, 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 498 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.
Referenced by lowerNonLocalAlloca().
Deallocate memory according to the rules of the active lowering.
| CG | - if non-null, will be updated for the new call |
Definition at line 521 of file Coroutines.cpp.
References ABI, addCallToCallGraph(), llvm::coro::Async, Call, llvm_unreachable, propagateCallAttrsFromCallee(), llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
Referenced by lowerNonLocalAlloca(), and maybeFreeRetconStorage().
|
inline |
Definition at line 163 of file CoroShape.h.
References ABI, assert(), llvm::coro::Async, llvm::cast(), and CoroBegin.
Referenced by analyze().
|
inline |
Definition at line 173 of file CoroShape.h.
References getIndexType().
Referenced by markCoroutineAsDone().
|
inline |
Definition at line 168 of file CoroShape.h.
References ABI, assert(), llvm::coro::Switch, and SwitchLowering.
Referenced by buildFrameDebugInfo(), and getIndex().
|
inline |
Definition at line 243 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 237 of file CoroShape.h.
References ABI, llvm::coro::Switch, and SwitchLowering.
Referenced by buildFrameLayout().
|
inline |
Definition at line 220 of file CoroShape.h.
References ABI, llvm::coro::Async, AsyncLowering, llvm::CallingConv::C, llvm_unreachable, llvm::coro::Retcon, RetconLowering, llvm::coro::RetconOnce, and llvm::coro::Switch.
|
inline |
Definition at line 183 of file CoroShape.h.
References ABI, llvm::coro::Async, CoroBegin, 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 158 of file CoroShape.h.
References ABI, assert(), llvm::cast(), CoroBegin, llvm::coro::Retcon, and llvm::coro::RetconOnce.
Referenced by analyze(), and buildFrameLayout().
Definition at line 200 of file CoroShape.h.
References ABI, llvm::ArrayRef(), assert(), CoroBegin, llvm::dyn_cast(), llvm::coro::Retcon, and llvm::coro::RetconOnce.
Definition at line 212 of file CoroShape.h.
References ABI, assert(), llvm::coro::Retcon, RetconLowering, and llvm::coro::RetconOnce.
|
inline |
Definition at line 153 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 177 of file CoroShape.h.
References ABI, assert(), CoroBegin, llvm::PointerType::getUnqual(), and llvm::coro::Switch.
Referenced by buildFrameDebugInfo(), buildFrameLayout(), markCoroutineAsDone(), and replaceSwitchResumeCoroFree().
| void coro::Shape::invalidateCoroutine | ( | Function & | F, |
| SmallVectorImpl< CoroFrameInst * > & | CoroFrames ) |
Definition at line 342 of file Coroutines.cpp.
References assert(), llvm::changeToUnreachable(), CoroBegin, CoroEnds, CoroSuspends, llvm::sampleprof::CS, 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 105 of file CoroShape.h.
Referenced by analyze(), buildFrameDebugInfo(), buildFrameLayout(), collectFrameAlloca(), createCloneDeclaration(), CreateNewABI(), doSplitCoroutine(), emitAlloc(), emitDealloc(), getAsyncCoroId(), getIndexType(), getPromiseAlloca(), getResumeFunctionCC(), getResumeFunctionType(), getRetconCoroId(), getRetconResultTypes(), getRetconResumeTypes(), getSwitchCoroId(), 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 110 of file CoroShape.h.
Referenced by clear(), and insertSpills().
| AsyncLoweringStorage llvm::coro::Shape::AsyncLowering |
Definition at line 150 of file CoroShape.h.
Referenced by analyze(), buildFrameLayout(), getResumeFunctionCC(), and updateAsyncFuncPointerContextSize().
| SmallVector<CoroAlignInst *, 2> llvm::coro::Shape::CoroAligns |
Definition at line 59 of file CoroShape.h.
Referenced by analyze(), clear(), and replaceFrameSizeAndAlignment().
| SmallVector<CoroAwaitSuspendInst *, 4> llvm::coro::Shape::CoroAwaitSuspends |
Definition at line 66 of file CoroShape.h.
Referenced by analyze(), clear(), and lowerAwaitSuspends().
| CoroBeginInst* llvm::coro::Shape::CoroBegin = nullptr |
Definition at line 55 of file CoroShape.h.
Referenced by analyze(), cleanCoroutine(), clear(), llvm::coro::collectSpillsAndAllocasFromInsts(), createGEPToFramePointer(), CreateNewABI(), createStoreIntoFrame(), doSplitCoroutine(), getAsyncCoroId(), getResumeFunctionType(), getRetconCoroId(), getRetconResultTypes(), llvm::coro::getSpillInsertionPt(), getSwitchCoroId(), getSwitchResumePointerType(), handleNoSuspendCoroutine(), insertSpills(), invalidateCoroutine(), llvm::CoroSplitPass::run(), Shape(), and simplifySuspendPoints().
| SmallVector<AnyCoroEndInst *, 4> llvm::coro::Shape::CoroEnds |
Definition at line 56 of file CoroShape.h.
Referenced by analyze(), clear(), eliminateSwiftErrorArgument(), invalidateCoroutine(), llvm::coro::normalizeCoroutine(), removeCoroEndsFromRampFunction(), and llvm::SuspendCrossingInfo::SuspendCrossingInfo().
| SmallVector<CoroIsInRampInst *, 2> llvm::coro::Shape::CoroIsInRampInsts |
Definition at line 57 of file CoroShape.h.
Referenced by analyze(), clear(), removeCoroIsInRampFromRampFunction(), and llvm::SuspendCrossingInfo::SuspendCrossingInfo().
| SmallVector<CoroSizeInst *, 2> llvm::coro::Shape::CoroSizes |
Definition at line 58 of file CoroShape.h.
Referenced by analyze(), clear(), and replaceFrameSizeAndAlignment().
| SmallVector<AnyCoroSuspendInst *, 4> llvm::coro::Shape::CoroSuspends |
Definition at line 60 of file CoroShape.h.
Referenced by analyze(), buildFrameLayout(), clear(), collectFrameAlloca(), doSplitCoroutine(), eliminateSwiftErrorArgument(), invalidateCoroutine(), markCoroutineAsDone(), llvm::coro::normalizeCoroutine(), replaceSwiftErrorOps(), llvm::CoroSplitPass::run(), simplifySuspendPoints(), sinkLifetimeStartMarkers(), and llvm::SuspendCrossingInfo::SuspendCrossingInfo().
| Align llvm::coro::Shape::FrameAlign |
Definition at line 107 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameLayout(), handleNoSuspendCoroutine(), replaceFrameSizeAndAlignment(), and llvm::CoroSplitPass::run().
| Value* llvm::coro::Shape::FramePtr = nullptr |
Definition at line 109 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), clear(), createGEPToFramePointer(), createStoreIntoFrame(), getInsertPtAfterFramePtr(), and removeCoroEndsFromRampFunction().
| uint64_t llvm::coro::Shape::FrameSize = 0 |
Definition at line 108 of file CoroShape.h.
Referenced by buildFrameDebugInfo(), buildFrameLayout(), handleNoSuspendCoroutine(), replaceFrameSizeAndAlignment(), and llvm::CoroSplitPass::run().
| std::optional<uint64_t> llvm::coro::Shape::ResumeEntryCount |
Definition at line 65 of file CoroShape.h.
Referenced by clear(), and llvm::CoroSplitPass::run().
| RetconLoweringStorage llvm::coro::Shape::RetconLowering |
Definition at line 149 of file CoroShape.h.
Referenced by analyze(), buildFrameLayout(), emitAlloc(), emitDealloc(), getResumeFunctionCC(), getResumeFunctionType(), getRetconResumeTypes(), and maybeFreeRetconStorage().
| SmallDenseMap<AnyCoroSuspendInst *, uint64_t, 4> llvm::coro::Shape::SuspendFreqs |
Definition at line 63 of file CoroShape.h.
Referenced by clear(), and llvm::CoroSplitPass::run().
| SmallVector<CallInst *, 2> llvm::coro::Shape::SwiftErrorOps |
Definition at line 70 of file CoroShape.h.
Referenced by clear(), emitGetSwiftErrorValue(), emitSetSwiftErrorValue(), and replaceSwiftErrorOps().
| SwitchLoweringStorage llvm::coro::Shape::SwitchLowering |
Definition at line 148 of file CoroShape.h.
Referenced by analyze(), buildFrameDebugInfo(), buildFrameLayout(), collectFrameAlloca(), createSwitchDestroyPtr(), createSwitchIndexPtr(), doSplitCoroutine(), getIndexType(), getPromiseAlloca(), hasAccessingPromiseBeforeCB(), markCoroutineAsDone(), llvm::coro::normalizeCoroutine(), simplifySuspendPoints(), and updateCallGraphAfterCoroutineSplit().
| SmallVector<CallInst *, 2> llvm::coro::Shape::SymmetricTransfers |
Definition at line 67 of file CoroShape.h.
Referenced by clear(), and lowerAwaitSuspend().