LLVM  10.0.0svn
Classes | Namespaces | Macros | Enumerations | Functions | Variables
CalledValuePropagation.cpp File Reference
#include "llvm/Transforms/IPO/CalledValuePropagation.h"
#include "llvm/Analysis/SparsePropagation.h"
#include "llvm/Analysis/ValueLatticeUtils.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/Transforms/IPO.h"
Include dependency graph for CalledValuePropagation.cpp:

Go to the source code of this file.

Classes

struct  llvm::LatticeKeyInfo< CVPLatticeKey >
 A specialization of LatticeKeyInfo for CVPLatticeKeys. More...
 

Namespaces

 llvm
 This class represents lattice values for constants.
 

Macros

#define DEBUG_TYPE   "called-value-propagation"
 

Enumerations

enum  IPOGrouping
 To enable interprocedural analysis, we assign LLVM values to the following groups. More...
 

Functions

static bool runCVP (Module &M)
 
 INITIALIZE_PASS (CalledValuePropagationLegacyPass, "called-value-propagation", "Called Value Propagation", false, false) ModulePass *llvm
 

Variables

static cl::opt< unsignedMaxFunctionsPerValue ("cvp-max-functions-per-value", cl::Hidden, cl::init(4), cl::desc("The maximum number of functions to track per lattice value"))
 The maximum number of functions to track per lattice value. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "called-value-propagation"

Definition at line 27 of file CalledValuePropagation.cpp.

Enumeration Type Documentation

◆ IPOGrouping

enum IPOGrouping
strong

To enable interprocedural analysis, we assign LLVM values to the following groups.

The register group represents SSA registers, the return group represents the return values of functions, and the memory group represents in-memory values. An LLVM Value can technically be in more than one group. It's necessary to distinguish these groups so we can, for example, track a global variable separately from the value stored at its location.

Definition at line 47 of file CalledValuePropagation.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( CalledValuePropagationLegacyPass  ,
"called-value-propagation ,
"Called Value Propagation ,
false  ,
false   
)

Definition at line 432 of file CalledValuePropagation.cpp.

◆ runCVP()

static bool runCVP ( Module M)
static

Variable Documentation

◆ MaxFunctionsPerValue

cl::opt<unsigned> MaxFunctionsPerValue("cvp-max-functions-per-value", cl::Hidden, cl::init(4), cl::desc("The maximum number of functions to track per lattice value"))
static

The maximum number of functions to track per lattice value.

Once the number of functions a call site can possibly target exceeds this threshold, it's lattice value becomes overdefined. The number of possible lattice values is bounded by Ch(F, M), where F is the number of functions in the module and M is MaxFunctionsPerValue. As such, this value should be kept very small. We likely can't do anything useful for call sites with a large number of possible targets, anyway.