LLVM  10.0.0
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/CallSite.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 CoroSaveInst * createCoroSave (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)
 
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...
 

Function Documentation

◆ addCallToCallGraph()

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

Definition at line 494 of file Coroutines.cpp.

References llvm::Instruction::getFunction().

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 189 of file Coroutines.cpp.

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

◆ checkConstantInt()

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

Definition at line 620 of file Coroutines.cpp.

References fail().

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

◆ checkWFAlloc()

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

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

Definition at line 591 of file Coroutines.cpp.

References llvm::dyn_cast(), F(), fail(), 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 606 of file Coroutines.cpp.

References llvm::dyn_cast(), F(), fail(), 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 555 of file Coroutines.cpp.

References llvm::dyn_cast(), F(), fail(), llvm::Instruction::getFunction(), llvm::Function::getFunctionType(), llvm::FunctionType::getReturnType(), and llvm::Value::stripPointerCasts().

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

◆ clear()

static void clear ( coro::Shape &  Shape)
static

Definition at line 226 of file Coroutines.cpp.

References llvm::coro::Shape::AllocaSpillBlock, llvm::coro::Shape::CoroBegin, llvm::coro::Shape::CoroEnds, llvm::coro::Shape::CoroSizes, llvm::coro::Shape::CoroSuspends, llvm::coro::Shape::FramePtr, and llvm::coro::Shape::FrameTy.

Referenced by llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::assign(), llvm::AttrBuilder::AttrBuilder(), llvm::coro::Shape::buildFrom(), llvm::rdf::RegisterAggr::clear(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::clearAndLeakNodesUnsafely(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::cloneFrom(), createRdxShuffleMask(), llvm::SplitAnalysis::didRepairRange(), llvm::msgpack::Document::Document(), llvm::GVNExpression::Expression::dump(), llvm::DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(), llvm::DWARFAbbreviationDeclaration::extract(), llvm::DWARFListTableBase< DWARFDebugRnglist >::extract(), llvm::ScalarEvolution::forgetValue(), llvm::msgpack::Document::fromYAML(), llvm::DWARFDebugLine::LineTable::getFileNameByIndex(), llvm::DWARFUnit::getLocationTable(), llvm::BlockFrequencyInfoImplBase::getLoopPackage(), llvm::DWARFDebugLine::Prologue::getMaxLineIncrementForSpecialOpcode(), llvm::Timer::hasTriggered(), llvm::InterferenceCache::init(), llvm::IntervalMap< SlotIndex, unsigned >::insert(), intersect(), llvm::SparseBitVector< ElementSize >::intersectWithComplement(), llvm::isAllocaPromotable(), llvm::rdf::RegisterAggr::isCoverOf(), isRegOtherThanSPAndFP(), llvm::DWARFDebugLine::LineTable::LineTable(), false::IntervalSorter::operator()(), llvm::PooledStringPtr::operator=(), llvm::DataLayout::operator=(), llvm::DWARFDebugLine::Prologue::parse(), llvm::DWARFDebugLine::LineTable::parse(), llvm::DWARFDebugLine::Prologue::Prologue(), llvm::rdf::NodeAllocator::ptr(), removeDebugValues(), llvm::DataLayout::reset(), llvm::MachineFunction::reset(), llvm::FastMathFlags::setFast(), llvm::SelectionDAG::setFunctionLoweringInfo(), llvm::TimerGroup::setName(), llvm::AliasSetTracker::~AliasSetTracker(), llvm::DataLayout::~DataLayout(), llvm::IntervalMap< SlotIndex, unsigned >::~IntervalMap(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::~iplist_impl(), and llvm::PooledStringPtr::~PooledStringPtr().

◆ 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