LLVM  13.0.0git
Functions
Coroutines.cpp File Reference
#include "llvm/Transforms/Coroutines.h"
#include "CoroInstr.h"
#include "CoroInternal.h"
#include "llvm-c/Transforms/Coroutines.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Utils/Local.h"
#include <cassert>
#include <cstddef>
#include <utility>
Include dependency graph for Coroutines.cpp:

Go to the source code of this file.

Functions

static void addCoroutineOpt0Passes (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addCoroutineEarlyPasses (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addCoroutineScalarOptimizerPasses (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addCoroutineSCCPasses (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addCoroutineOptimizerLastPasses (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static bool isCoroutineIntrinsicName (StringRef Name)
 
static void buildCGN (CallGraph &CG, CallGraphNode *Node)
 
static void clear (coro::Shape &Shape)
 
static CoroSaveInstcreateCoroSave (CoroBeginInst *CoroBegin, CoroSuspendInst *SuspendInst)
 
static void propagateCallAttrsFromCallee (CallInst *Call, Function *Callee)
 
static void addCallToCallGraph (CallGraph *CG, CallInst *Call, Function *Callee)
 
static LLVM_ATTRIBUTE_NORETURN void fail (const Instruction *I, const char *Reason, Value *V)
 
static void checkWFRetconPrototype (const AnyCoroIdRetconInst *I, Value *V)
 Check that the given value is a well-formed prototype for the llvm.coro.id.retcon. More...
 
static void checkWFAlloc (const Instruction *I, Value *V)
 Check that the given value is a well-formed allocator. More...
 
static void checkWFDealloc (const Instruction *I, Value *V)
 Check that the given value is a well-formed deallocator. More...
 
static void checkConstantInt (const Instruction *I, Value *V, const char *Reason)
 
static void checkAsyncFuncPointer (const Instruction *I, Value *V)
 
static void checkAsyncContextProjectFunction (const Instruction *I, Function *F)
 
void LLVMAddCoroEarlyPass (LLVMPassManagerRef PM)
 See llvm::createCoroEarlyLegacyPass function. More...
 
void LLVMAddCoroSplitPass (LLVMPassManagerRef PM)
 See llvm::createCoroSplitLegacyPass function. More...
 
void LLVMAddCoroElidePass (LLVMPassManagerRef PM)
 See llvm::createCoroElideLegacyPass function. More...
 
void LLVMAddCoroCleanupPass (LLVMPassManagerRef PM)
 See llvm::createCoroCleanupLegacyPass function. More...
 
void LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints (LLVMPassManagerBuilderRef PMB)
 See llvm::addCoroutinePassesToExtensionPoints. More...
 

Function Documentation

◆ addCallToCallGraph()

static void addCallToCallGraph ( CallGraph CG,
CallInst Call,
Function Callee 
)
static

Definition at line 524 of file Coroutines.cpp.

References Callee.

Referenced by llvm::coro::Shape::emitDealloc().

◆ addCoroutineEarlyPasses()

static void addCoroutineEarlyPasses ( const PassManagerBuilder Builder,
legacy::PassManagerBase PM 
)
static

◆ addCoroutineOpt0Passes()

static void addCoroutineOpt0Passes ( const PassManagerBuilder Builder,
legacy::PassManagerBase PM 
)
static

◆ addCoroutineOptimizerLastPasses()

static void addCoroutineOptimizerLastPasses ( const PassManagerBuilder Builder,
legacy::PassManagerBase PM 
)
static

◆ addCoroutineScalarOptimizerPasses()

static void addCoroutineScalarOptimizerPasses ( const PassManagerBuilder Builder,
legacy::PassManagerBase PM 
)
static

◆ addCoroutineSCCPasses()

static void addCoroutineSCCPasses ( const PassManagerBuilder Builder,
legacy::PassManagerBase PM 
)
static

◆ buildCGN()

static void buildCGN ( CallGraph CG,
CallGraphNode Node 
)
static

Definition at line 196 of file Coroutines.cpp.

Referenced by llvm::coro::updateCallGraph().

◆ checkAsyncContextProjectFunction()

static void checkAsyncContextProjectFunction ( const Instruction I,
Function F 
)
static

Definition at line 698 of file Coroutines.cpp.

References F, fail(), and I.

Referenced by llvm::CoroSuspendAsyncInst::checkWellFormed().

◆ checkAsyncFuncPointer()

static void checkAsyncFuncPointer ( const Instruction I,
Value V 
)
static

Definition at line 671 of file Coroutines.cpp.

References fail(), I, and llvm::Value::stripPointerCasts().

Referenced by llvm::CoroIdAsyncInst::checkWellFormed().

◆ checkConstantInt()

static void checkConstantInt ( const Instruction I,
Value V,
const char *  Reason 
)
static

Definition at line 654 of file Coroutines.cpp.

References fail(), and I.

Referenced by llvm::AnyCoroIdRetconInst::checkWellFormed(), and llvm::CoroIdAsyncInst::checkWellFormed().

◆ checkWFAlloc()

static void checkWFAlloc ( const Instruction I,
Value V 
)
static

Check that the given value is a well-formed allocator.

Definition at line 625 of file Coroutines.cpp.

References F, fail(), I, and llvm::Value::stripPointerCasts().

Referenced by llvm::AnyCoroIdRetconInst::checkWellFormed().

◆ checkWFDealloc()

static void checkWFDealloc ( const Instruction I,
Value V 
)
static

Check that the given value is a well-formed deallocator.

Definition at line 640 of file Coroutines.cpp.

References F, fail(), I, and llvm::Value::stripPointerCasts().

Referenced by llvm::AnyCoroIdRetconInst::checkWellFormed().

◆ checkWFRetconPrototype()

static void checkWFRetconPrototype ( const AnyCoroIdRetconInst I,
Value V 
)
static

Check that the given value is a well-formed prototype for the llvm.coro.id.retcon.

  • intrinsics.

Definition at line 589 of file Coroutines.cpp.

References F, fail(), I, and llvm::Value::stripPointerCasts().

Referenced by llvm::AnyCoroIdRetconInst::checkWellFormed().

◆ clear()

static void clear ( coro::Shape Shape)
static

◆ createCoroSave()

static CoroSaveInst* createCoroSave ( CoroBeginInst CoroBegin,
CoroSuspendInst SuspendInst 
)
static

◆ fail()

static LLVM_ATTRIBUTE_NORETURN void fail ( const Instruction I,
const char *  Reason,
Value V 
)
static

◆ isCoroutineIntrinsicName()

static bool isCoroutineIntrinsicName ( StringRef  Name)
static

◆ propagateCallAttrsFromCallee()

static void propagateCallAttrsFromCallee ( CallInst Call,
Function Callee 
)
static

Definition at line 519 of file Coroutines.cpp.

References Callee.

Referenced by llvm::coro::Shape::emitDealloc().