LLVM
15.0.0git
|
#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/InitializePasses.h"
#include "llvm/Pass.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 | |
llvm | |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "called-value-propagation" |
Functions | |
static bool | runCVP (Module &M) |
INITIALIZE_PASS (CalledValuePropagationLegacyPass, "called-value-propagation", "Called Value Propagation", false, false) ModulePass *llvm | |
Variables | |
static 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")) |
The maximum number of functions to track per lattice value. More... | |
#define DEBUG_TYPE "called-value-propagation" |
Definition at line 31 of file CalledValuePropagation.cpp.
INITIALIZE_PASS | ( | CalledValuePropagationLegacyPass | , |
"called-value-propagation" | , | ||
"Called Value Propagation" | , | ||
false | , | ||
false | |||
) |
Definition at line 432 of file CalledValuePropagation.cpp.
|
static |
Definition at line 371 of file CalledValuePropagation.cpp.
References llvm::canTrackArgumentsInterprocedurally(), llvm::MDBuilder::createCallees(), F, llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::getExistingValueState(), M, llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::MarkBlockExecutable(), Register, and llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::Solve().
Referenced by llvm::CalledValuePropagationPass::run().
|
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.