LLVM  5.0.0
Macros | Functions
CoroSplit.cpp File Reference
#include "CoroInternal.h"
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
Include dependency graph for CoroSplit.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "coro-split"
 

Functions

static BasicBlock * createResumeEntryBlock (Function &F, coro::Shape &Shape)
 
static void replaceFallthroughCoroEnd (IntrinsicInst *End, ValueToValueMapTy &VMap)
 
static void replaceUnwindCoroEnds (coro::Shape &Shape, ValueToValueMapTy &VMap)
 
static void handleFinalSuspend (IRBuilder<> &Builder, Value *FramePtr, coro::Shape &Shape, SwitchInst *Switch, bool IsDestroy)
 
static Function * createClone (Function &F, Twine Suffix, coro::Shape &Shape, BasicBlock *ResumeEntry, int8_t FnIndex)
 
static void removeCoroEnds (coro::Shape &Shape)
 
static void replaceFrameSize (coro::Shape &Shape)
 
static void setCoroInfo (Function &F, CoroBeginInst *CoroBegin, std::initializer_list< Function * > Fns)
 
static void updateCoroFrame (coro::Shape &Shape, Function *ResumeFn, Function *DestroyFn, Function *CleanupFn)
 
static void postSplitCleanup (Function &F)
 
static void handleNoSuspendCoroutine (CoroBeginInst *CoroBegin, Type *FrameTy)
 
static bool simplifySuspendPoint (CoroSuspendInst *Suspend, CoroBeginInst *CoroBegin)
 
static void simplifySuspendPoints (coro::Shape &Shape)
 
static SmallPtrSet< BasicBlock *, 4 > getCoroBeginPredBlocks (CoroBeginInst *CB)
 
static SmallPtrSet
< Instruction *, 8 > 
getNotRelocatableInstructions (CoroBeginInst *CoroBegin, SmallPtrSetImpl< BasicBlock * > &RelocBlocks)
 
static void relocateInstructionBefore (CoroBeginInst *CoroBegin, Function &F)
 
static void splitCoroutine (Function &F, CallGraph &CG, CallGraphSCC &SCC)
 
static void prepareForSplit (Function &F, CallGraph &CG)
 
static void createDevirtTriggerFunc (CallGraph &CG, CallGraphSCC &SCC)
 
 INITIALIZE_PASS (CoroSplit,"coro-split","Split coroutine into a set of functions driving its state machine", false, false) Pass *llvm
 

Macro Definition Documentation

#define DEBUG_TYPE   "coro-split"

Definition at line 36 of file CoroSplit.cpp.

Function Documentation

static Function* createClone ( Function &  F,
Twine  Suffix,
coro::Shape &  Shape,
BasicBlock *  ResumeEntry,
int8_t  FnIndex 
)
static
static void createDevirtTriggerFunc ( CallGraph &  CG,
CallGraphSCC &  SCC 
)
static
static BasicBlock* createResumeEntryBlock ( Function &  F,
coro::Shape &  Shape 
)
static
static SmallPtrSet<BasicBlock *, 4> getCoroBeginPredBlocks ( CoroBeginInst *  CB)
static
static SmallPtrSet<Instruction *, 8> getNotRelocatableInstructions ( CoroBeginInst *  CoroBegin,
SmallPtrSetImpl< BasicBlock * > &  RelocBlocks 
)
static
static void handleFinalSuspend ( IRBuilder<> &  Builder,
Value *  FramePtr,
coro::Shape &  Shape,
SwitchInst *  Switch,
bool  IsDestroy 
)
static
static void handleNoSuspendCoroutine ( CoroBeginInst *  CoroBegin,
Type *  FrameTy 
)
static
INITIALIZE_PASS ( CoroSplit  ,
"coro-split"  ,
"Split coroutine into a set of functions driving its state machine"  ,
false  ,
false   
)

Definition at line 737 of file CoroSplit.cpp.

static void postSplitCleanup ( Function &  F)
static
static void prepareForSplit ( Function &  F,
CallGraph &  CG 
)
static
static void relocateInstructionBefore ( CoroBeginInst *  CoroBegin,
Function &  F 
)
static
static void removeCoroEnds ( coro::Shape &  Shape)
static
static void replaceFallthroughCoroEnd ( IntrinsicInst *  End,
ValueToValueMapTy &  VMap 
)
static
static void replaceFrameSize ( coro::Shape &  Shape)
static
static void replaceUnwindCoroEnds ( coro::Shape &  Shape,
ValueToValueMapTy &  VMap 
)
static
static void setCoroInfo ( Function &  F,
CoroBeginInst *  CoroBegin,
std::initializer_list< Function * >  Fns 
)
static
static bool simplifySuspendPoint ( CoroSuspendInst *  Suspend,
CoroBeginInst *  CoroBegin 
)
static
static void simplifySuspendPoints ( coro::Shape &  Shape)
static
static void splitCoroutine ( Function &  F,
CallGraph &  CG,
CallGraphSCC &  SCC 
)
static
static void updateCoroFrame ( coro::Shape &  Shape,
Function *  ResumeFn,
Function *  DestroyFn,
Function *  CleanupFn 
)
static