X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FScalar%2FGCSE.cpp;h=771b9690fad43584d89c9fc28d39bf8861af86b9;hb=0006bd75201f340b95c1dbf71e50dc5de5ed9425;hp=ef1d056ed7520783ee7b1bbe615cf21ed86ecbc4;hpb=14987f16b4c67ff13e753b1b930b319ca098ce30;p=oota-llvm.git diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index ef1d056ed75..771b9690fad 100644 --- a/lib/Transforms/Scalar/GCSE.cpp +++ b/lib/Transforms/Scalar/GCSE.cpp @@ -2,33 +2,28 @@ // // This pass is designed to be a very quick global transformation that // eliminates global common subexpressions from a function. It does this by -// examining the SSA value graph of the function, instead of doing slow, dense, -// bit-vector computations. +// using an existing value numbering implementation to identify the common +// subexpressions, eliminating them when possible. // //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar.h" -#include "llvm/InstrTypes.h" #include "llvm/iMemory.h" +#include "llvm/Type.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/ValueNumbering.h" #include "llvm/Support/InstIterator.h" -#include "llvm/Support/CFG.h" -#include "llvm/Type.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include -using std::set; -using std::map; - namespace { - Statistic<> NumInstRemoved("gcse\t\t- Number of instructions removed"); - Statistic<> NumLoadRemoved("gcse\t\t- Number of loads removed"); - Statistic<> NumNonInsts ("gcse\t\t- Number of instructions removed due " + Statistic<> NumInstRemoved("gcse", "Number of instructions removed"); + Statistic<> NumLoadRemoved("gcse", "Number of loads removed"); + Statistic<> NumNonInsts ("gcse", "Number of instructions removed due " "to non-instruction values"); class GCSE : public FunctionPass { - set WorkList; + std::set WorkList; DominatorSet *DomSetInfo; #if 0 ImmediateDominators *ImmDominator; @@ -44,7 +39,7 @@ namespace { // This transformation requires dominator and immediate dominator info virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); AU.addRequired(); AU.addRequired(); AU.addRequired();