LLVM 20.0.0git
Classes | Namespaces | Macros | 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/Constants.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/IPO.h"

Go to the source code of this file.

Classes

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

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define DEBUG_TYPE   "called-value-propagation"
 

Functions

static bool runCVP (Module &M)
 

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.
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "called-value-propagation"

Definition at line 30 of file CalledValuePropagation.cpp.

Function Documentation

◆ 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")) ( "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.