|
LLVM
10.0.0
|
#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/CallSite.h"#include "llvm/IR/Constants.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/Module.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Transforms/IPO.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "ipconstprop" |
Functions | |
| STATISTIC (NumArgumentsProped, "Number of args turned into constants") | |
| STATISTIC (NumReturnValProped, "Number of return values turned into constants") | |
| static bool | PropagateConstantsIntoArguments (Function &F) |
| PropagateConstantsIntoArguments - Look at all uses of the specified function. More... | |
| static bool | PropagateConstantReturn (Function &F) |
| INITIALIZE_PASS (IPCP, "ipconstprop", "Interprocedural constant propagation", false, false) ModulePass *llvm | |
| #define DEBUG_TYPE "ipconstprop" |
Definition at line 29 of file IPConstantPropagation.cpp.
| INITIALIZE_PASS | ( | IPCP | , |
| "ipconstprop" | , | ||
| "Interprocedural constant propagation" | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 282 of file IPConstantPropagation.cpp.
References F(), PropagateConstantReturn(), and PropagateConstantsIntoArguments().
Definition at line 153 of file IPConstantPropagation.cpp.
References llvm::dyn_cast(), llvm::numbers::e, E, llvm::Instruction::eraseFromParent(), llvm::FindInsertedValue(), llvm::UndefValue::get(), llvm::StructType::getElementType(), llvm::StructType::getNumElements(), llvm::Function::getReturnType(), llvm::Function::hasFnAttribute(), I, llvm::MipsISD::Ins, llvm::GlobalValue::isDefinitionExact(), llvm::Type::isVoidTy(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Value::replaceAllUsesWith(), and llvm::SmallVectorBase::size().
Referenced by INITIALIZE_PASS().
PropagateConstantsIntoArguments - Look at all uses of the specified function.
If all uses are direct call sites, and all pass a particular constant in for an argument, propagate that constant in as the argument.
Definition at line 51 of file IPConstantPropagation.cpp.
References Arg, llvm::Function::arg_begin(), llvm::Function::arg_empty(), llvm::Function::arg_size(), assert(), C, llvm::numbers::e, first, llvm::UndefValue::get(), llvm::AbstractCallSite::getCallArgOperand(), llvm::AbstractCallSite::getNumArgOperands(), llvm::Value::getType(), llvm::Argument::hasByValAttr(), llvm::Argument::hasInAllocaAttr(), llvm::AbstractCallSite::isCallbackCall(), llvm::Constant::isThreadDependent(), llvm::Function::isVarArg(), llvm::Function::onlyReadsMemory(), llvm::Value::replaceAllUsesWith(), llvm::SmallVectorImpl< T >::resize(), second, llvm::SmallVectorBase::size(), llvm::Value::use_empty(), and llvm::Value::uses().
Referenced by INITIALIZE_PASS().
| STATISTIC | ( | NumArgumentsProped | , |
| "Number of args turned into constants" | |||
| ) |
| STATISTIC | ( | NumReturnValProped | , |
| "Number of return values turned into constants" | |||
| ) |
1.8.13