LLVM  14.0.0git
Macros | Functions | Variables
CoroElide.cpp File Reference
#include "llvm/Transforms/Coroutines/CoroElide.h"
#include "CoroInternal.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
Include dependency graph for CoroElide.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "coro-elide"
 

Functions

 STATISTIC (NumOfCoroElided, "The # of coroutine get elided.")
 
static void replaceWithConstant (Constant *Value, SmallVectorImpl< CoroSubFnInst * > &Users)
 
static bool operandReferences (CallInst *CI, AllocaInst *Frame, AAResults &AA)
 
static void removeTailCallAttribute (AllocaInst *Frame, AAResults &AA)
 
static std::pair< uint64_t, AligngetFrameLayout (Function *Resume)
 
static InstructiongetFirstNonAllocaInTheEntryBlock (Function *F)
 
static std::unique_ptr< raw_fd_ostreamgetOrCreateLogFile ()
 
static bool replaceDevirtTrigger (Function &F)
 
static bool declaresCoroElideIntrinsics (Module &M)
 
 INITIALIZE_PASS_BEGIN (CoroElideLegacy, "coro-elide", "Coroutine frame allocation elision and indirect calls replacement", false, false) INITIALIZE_PASS_END(CoroElideLegacy
 

Variables

static cl::opt< std::string > CoroElideInfoOutputFilename ("coro-elide-info-output-file", cl::value_desc("filename"), cl::desc("File to record the coroutines got elided"), cl::Hidden)
 
coro elide
 
coro Coroutine frame allocation elision and indirect calls replacement
 
coro Coroutine frame allocation elision and indirect calls false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "coro-elide"

Definition at line 24 of file CoroElide.cpp.

Function Documentation

◆ declaresCoroElideIntrinsics()

static bool declaresCoroElideIntrinsics ( Module M)
static

Definition at line 400 of file CoroElide.cpp.

References llvm::coro::declaresIntrinsics(), and M.

Referenced by llvm::CoroElidePass::run().

◆ getFirstNonAllocaInTheEntryBlock()

static Instruction* getFirstNonAllocaInTheEntryBlock ( Function F)
static

Definition at line 124 of file CoroElide.cpp.

References F, I, and llvm_unreachable.

◆ getFrameLayout()

static std::pair<uint64_t, Align> getFrameLayout ( Function Resume)
static

◆ getOrCreateLogFile()

static std::unique_ptr<raw_fd_ostream> getOrCreateLogFile ( )
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( CoroElideLegacy  ,
"coro-elide ,
"Coroutine frame allocation elision and indirect calls replacement ,
false  ,
false   
)

◆ operandReferences()

static bool operandReferences ( CallInst CI,
AllocaInst Frame,
AAResults AA 
)
static

Definition at line 81 of file CoroElide.cpp.

References llvm::AAResults::isNoAlias(), and llvm::User::operand_values().

Referenced by removeTailCallAttribute().

◆ removeTailCallAttribute()

static void removeTailCallAttribute ( AllocaInst Frame,
AAResults AA 
)
static

◆ replaceDevirtTrigger()

static bool replaceDevirtTrigger ( Function F)
static

◆ replaceWithConstant()

static void replaceWithConstant ( Constant Value,
SmallVectorImpl< CoroSubFnInst * > &  Users 
)
static

◆ STATISTIC()

STATISTIC ( NumOfCoroElided  ,
"The # of coroutine get elided."   
)

Variable Documentation

◆ CoroElideInfoOutputFilename

cl::opt<std::string> CoroElideInfoOutputFilename("coro-elide-info-output-file", cl::value_desc("filename"), cl::desc("File to record the coroutines got elided"), cl::Hidden)
static

Referenced by getOrCreateLogFile().

◆ elide

coro elide

Definition at line 479 of file CoroElide.cpp.

◆ false

coro Coroutine frame allocation elision and indirect calls false

Definition at line 480 of file CoroElide.cpp.

◆ replacement

coro Coroutine frame allocation elision and indirect calls replacement

Definition at line 480 of file CoroElide.cpp.