|
LLVM
4.0.0
|
#include "llvm/Transforms/IPO.h"#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/Pass.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 253 of file IPConstantPropagation.cpp.
Definition at line 130 of file IPConstantPropagation.cpp.
References A, llvm::Call, llvm::dyn_cast(), E, llvm::Instruction::eraseFromParent(), llvm::FindInsertedValue(), llvm::UndefValue::get(), llvm::StructType::getElementType(), llvm::StructType::getNumElements(), llvm::Function::getReturnType(), I, i, llvm::MipsISD::Ins, llvm::GlobalValue::isDefinitionExact(), llvm::Type::isVoidTy(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Value::replaceAllUsesWith(), and llvm::SmallVectorTemplateCommon< T >::size().
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 llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::Function::arg_begin(), llvm::Function::arg_empty(), llvm::Function::arg_size(), assert(), C, llvm::dyn_cast(), llvm::UndefValue::get(), i, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isCallee(), llvm::Function::onlyReadsMemory(), llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::Value::use_empty(), and llvm::Value::uses().
| STATISTIC | ( | NumArgumentsProped | , |
| "Number of args turned into constants" | |||
| ) |
| STATISTIC | ( | NumReturnValProped | , |
| "Number of return values turned into constants" | |||
| ) |
1.8.6