LLVM  4.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/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 BasicBlockcreateResumeEntryBlock (Function &F, coro::Shape &Shape)
 
static void replaceFallthroughCoroEnd (IntrinsicInst *End, ValueToValueMapTy &VMap)
 
static void handleFinalSuspend (IRBuilder<> &Builder, Value *FramePtr, coro::Shape &Shape, SwitchInst *Switch, bool IsDestroy)
 
static FunctioncreateClone (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 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 35 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 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 635 of file CoroSplit.cpp.

static void postSplitCleanup ( Function F)
static
static void prepareForSplit ( Function F,
CallGraph CG 
)
static
static void removeCoroEnds ( coro::Shape Shape)
static

Definition at line 286 of file CoroSplit.cpp.

References llvm::coro::Shape::CoroEnds, and llvm::Instruction::eraseFromParent().

Referenced by splitCoroutine().

static void replaceFallthroughCoroEnd ( IntrinsicInst End,
ValueToValueMapTy VMap 
)
static
static void replaceFrameSize ( coro::Shape Shape)
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