21 #define DEBUG_TYPE "constprop"
34 STATISTIC(NumInstKilled,
"Number of instructions killed");
54 "Simple constant propagation",
false,
false)
60 return new ConstantPropagation();
63 bool ConstantPropagation::runOnFunction(
Function &
F) {
65 std::set<Instruction*> WorkList;
73 while (!WorkList.empty()) {
75 WorkList.erase(WorkList.begin());
83 WorkList.insert(cast<Instruction>(*UI));
static PassRegistry * getPassRegistry()
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
inst_iterator inst_begin(Function *F)
STATISTIC(NumInstKilled,"Number of instructions killed")
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
FunctionPass * createConstantPropagationPass()
ID
LLVM Calling Convention Representation.
void initializeConstantPropagationPass(PassRegistry &)
Constant * ConstantFoldInstruction(Instruction *I, const DataLayout *TD=0, const TargetLibraryInfo *TLI=0)
void replaceAllUsesWith(Value *V)
LLVM Constant Representation.
INITIALIZE_PASS_BEGIN(ConstantPropagation,"constprop","Simple constant propagation", false, false) INITIALIZE_PASS_END(ConstantPropagation
Simple constant propagation
inst_iterator inst_end(Function *F)
INITIALIZE_PASS(GlobalMerge,"global-merge","Global Merge", false, false) bool GlobalMerge const DataLayout * TD