diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-10-01 22:38:41 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-10-01 22:38:41 +0000 |
| commit | bf3a099a624f442aa80e37499c9162479c8250d2 (patch) | |
| tree | 29ab73d0cc448ab3aa28ddb2ddc4b2926e52d506 /llvm/lib/Transforms/Scalar | |
| parent | 3cf3782bc032224ebf60ac5bc1d0e571bffda409 (diff) | |
| download | bcm5719-llvm-bf3a099a624f442aa80e37499c9162479c8250d2.tar.gz bcm5719-llvm-bf3a099a624f442aa80e37499c9162479c8250d2.zip | |
Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
* Broke constructor to take two const char * arguments instead of one, so
that indendation can be taken care of automatically.
* Sort the list by pass name when printing
* Make sure to print all statistics as a group, instead of randomly when
the statistics dtors are called.
* Updated ProgrammersManual with new semantics.
llvm-svn: 4002
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/BreakCriticalEdges.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ConstantProp.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DCE.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GCSE.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopSimplify.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LowerAllocations.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/PiNodeInsertion.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/Reassociate.cpp | 11 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyCFG.cpp | 6 |
16 files changed, 54 insertions, 58 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index 7d1d896bd22..e2e9e86216c 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -17,16 +17,14 @@ #include "llvm/Support/CFG.h" #include "Support/STLExtras.h" #include "Support/DepthFirstIterator.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <algorithm> -#include <iostream> using std::cerr; using std::vector; -static Statistic<> NumBlockRemoved("adce\t\t- Number of basic blocks removed"); -static Statistic<> NumInstRemoved ("adce\t\t- Number of instructions removed"); - namespace { + Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed"); + Statistic<> NumInstRemoved ("adce", "Number of instructions removed"); //===----------------------------------------------------------------------===// // ADCE Class diff --git a/llvm/lib/Transforms/Scalar/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Scalar/BreakCriticalEdges.cpp index 3927a81802b..fa33fc7397d 100644 --- a/llvm/lib/Transforms/Scalar/BreakCriticalEdges.cpp +++ b/llvm/lib/Transforms/Scalar/BreakCriticalEdges.cpp @@ -14,10 +14,10 @@ #include "llvm/iTerminators.h" #include "llvm/iPHINode.h" #include "llvm/Support/CFG.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" namespace { - Statistic<> NumBroken("break-crit-edges\t- Number of blocks inserted"); + Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted"); struct BreakCriticalEdges : public FunctionPass { virtual bool runOnFunction(Function &F); diff --git a/llvm/lib/Transforms/Scalar/ConstantProp.cpp b/llvm/lib/Transforms/Scalar/ConstantProp.cpp index 5da909e2020..1c0d33bee82 100644 --- a/llvm/lib/Transforms/Scalar/ConstantProp.cpp +++ b/llvm/lib/Transforms/Scalar/ConstantProp.cpp @@ -17,12 +17,12 @@ #include "llvm/Instruction.h" #include "llvm/Pass.h" #include "llvm/Support/InstIterator.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <set> -static Statistic<> NumInstKilled("constprop - Number of instructions killed"); - namespace { + Statistic<> NumInstKilled("constprop", "Number of instructions killed"); + struct ConstantPropogation : public FunctionPass { bool runOnFunction(Function &F); diff --git a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp index 441c7990f16..2ff504de6c0 100644 --- a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp +++ b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp @@ -32,13 +32,13 @@ #include "llvm/Support/ConstantRange.h" #include "llvm/Support/CFG.h" #include "Support/PostOrderIterator.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <algorithm> namespace { - Statistic<>NumSetCCRemoved("cee\t\t- Number of setcc instruction eliminated"); - Statistic<>NumOperandsCann("cee\t\t- Number of operands cannonicalized"); - Statistic<>BranchRevectors("cee\t\t- Number of branches revectored"); + Statistic<> NumSetCCRemoved("cee", "Number of setcc instruction eliminated"); + Statistic<> NumOperandsCann("cee", "Number of operands cannonicalized"); + Statistic<> BranchRevectors("cee", "Number of branches revectored"); class ValueInfo; class Relation { diff --git a/llvm/lib/Transforms/Scalar/DCE.cpp b/llvm/lib/Transforms/Scalar/DCE.cpp index 2903699a8d1..cfeb8685893 100644 --- a/llvm/lib/Transforms/Scalar/DCE.cpp +++ b/llvm/lib/Transforms/Scalar/DCE.cpp @@ -14,17 +14,17 @@ #include "llvm/Instruction.h" #include "llvm/Pass.h" #include "llvm/Support/InstIterator.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <set> -static Statistic<> DIEEliminated("die\t\t- Number of insts removed"); -static Statistic<> DCEEliminated("dce\t\t- Number of insts removed"); +namespace { + Statistic<> DIEEliminated("die", "Number of insts removed"); + Statistic<> DCEEliminated("dce", "Number of insts removed"); -//===----------------------------------------------------------------------===// -// DeadInstElimination pass implementation -// + //===--------------------------------------------------------------------===// + // DeadInstElimination pass implementation + // -namespace { struct DeadInstElimination : public BasicBlockPass { virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; diff --git a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index 2fb1346a5c8..d0f47d8b806 100644 --- a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp @@ -16,10 +16,10 @@ #include "llvm/iOther.h" #include "llvm/BasicBlock.h" #include "llvm/Pass.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" namespace { - Statistic<> NumAdded("lowerrefs\t\t- # of getelementptr instructions added"); + Statistic<> NumAdded("lowerrefs", "# of getelementptr instructions added"); struct DecomposePass : public BasicBlockPass { virtual bool runOnBasicBlock(BasicBlock &BB); diff --git a/llvm/lib/Transforms/Scalar/GCSE.cpp b/llvm/lib/Transforms/Scalar/GCSE.cpp index e8e140f2032..e5f10c849f4 100644 --- a/llvm/lib/Transforms/Scalar/GCSE.cpp +++ b/llvm/lib/Transforms/Scalar/GCSE.cpp @@ -13,13 +13,13 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/ValueNumbering.h" #include "llvm/Support/InstIterator.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <algorithm> 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 { diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 004297ff8f4..d7433802ee5 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -14,11 +14,11 @@ #include "llvm/Constants.h" #include "llvm/Support/CFG.h" #include "Support/STLExtras.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" namespace { - Statistic<> NumRemoved ("indvars\t\t- Number of aux indvars removed"); - Statistic<> NumInserted("indvars\t\t- Number of cannonical indvars added"); + Statistic<> NumRemoved ("indvars", "Number of aux indvars removed"); + Statistic<> NumInserted("indvars", "Number of cannonical indvars added"); } // InsertCast - Cast Val to Ty, setting a useful name on the cast if Val has a diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index b60d1fa9720..ec3ea074d92 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -25,14 +25,14 @@ #include "llvm/Pass.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/InstVisitor.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <algorithm> -static Statistic<> NumCombined ("instcombine\t- Number of insts combined"); -static Statistic<> NumConstProp("instcombine\t- Number of constant folds"); -static Statistic<> NumDeadInst ("instcombine\t- Number of dead inst eliminate"); - namespace { + Statistic<> NumCombined ("instcombine", "Number of insts combined"); + Statistic<> NumConstProp("instcombine", "Number of constant folds"); + Statistic<> NumDeadInst ("instcombine", "Number of dead inst eliminated"); + class InstCombiner : public FunctionPass, public InstVisitor<InstCombiner, Instruction*> { // Worklist of all of the instructions that need to be simplified. diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index bc0e433d29f..998dce937b2 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -13,14 +13,14 @@ #include "llvm/iMemory.h" #include "llvm/Support/InstVisitor.h" #include "Support/STLExtras.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include "llvm/Assembly/Writer.h" #include <algorithm> using std::string; namespace { - Statistic<>NumHoisted("licm\t\t- Number of instructions hoisted out of loop"); - Statistic<> NumHoistedLoads("licm\t\t- Number of load insts hoisted"); + Statistic<> NumHoisted("licm", "Number of instructions hoisted out of loop"); + Statistic<> NumHoistedLoads("licm", "Number of load insts hoisted"); struct LICM : public FunctionPass, public InstVisitor<LICM> { virtual bool runOnFunction(Function &F); diff --git a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp index 1432b1ca621..66c9aa5402b 100644 --- a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp @@ -13,10 +13,10 @@ #include "llvm/iPHINode.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" namespace { - Statistic<> NumInserted("preheaders\t- Number of pre-header nodes inserted"); + Statistic<> NumInserted("preheaders", "Number of pre-header nodes inserted"); struct Preheaders : public FunctionPass { virtual bool runOnFunction(Function &F); diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp index 99eb2d044e4..8c6550003dd 100644 --- a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp +++ b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp @@ -13,12 +13,12 @@ #include "llvm/Constants.h" #include "llvm/Pass.h" #include "llvm/Target/TargetData.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" -static Statistic<> NumLowered("lowerallocs\t- Number of allocations lowered"); using std::vector; namespace { + Statistic<> NumLowered("lowerallocs", "Number of allocations lowered"); /// LowerAllocations - Turn malloc and free instructions into %malloc and /// %free calls. diff --git a/llvm/lib/Transforms/Scalar/PiNodeInsertion.cpp b/llvm/lib/Transforms/Scalar/PiNodeInsertion.cpp index 940b56fd29b..9d431951d7c 100644 --- a/llvm/lib/Transforms/Scalar/PiNodeInsertion.cpp +++ b/llvm/lib/Transforms/Scalar/PiNodeInsertion.cpp @@ -29,16 +29,15 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Pass.h" #include "llvm/Function.h" -#include "llvm/BasicBlock.h" #include "llvm/iTerminators.h" #include "llvm/iOperators.h" #include "llvm/iPHINode.h" #include "llvm/Support/CFG.h" -#include "Support/StatisticReporter.h" - -static Statistic<> NumInserted("pinodes\t\t- Number of Pi nodes inserted"); +#include "Support/Statistic.h" namespace { + Statistic<> NumInserted("pinodes", "Number of Pi nodes inserted"); + struct PiNodeInserter : public FunctionPass { virtual bool runOnFunction(Function &F); diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index 7d76bfb681f..608ab52510c 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -18,20 +18,19 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Function.h" -#include "llvm/BasicBlock.h" #include "llvm/iOperators.h" #include "llvm/Type.h" #include "llvm/Pass.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" #include "Support/PostOrderIterator.h" -#include "Support/StatisticReporter.h" - -static Statistic<> NumLinear ("reassociate\t- Number of insts linearized"); -static Statistic<> NumChanged("reassociate\t- Number of insts reassociated"); -static Statistic<> NumSwapped("reassociate\t- Number of insts with operands swapped"); +#include "Support/Statistic.h" namespace { + Statistic<> NumLinear ("reassociate","Number of insts linearized"); + Statistic<> NumChanged("reassociate","Number of insts reassociated"); + Statistic<> NumSwapped("reassociate","Number of insts with operands swapped"); + class Reassociate : public FunctionPass { std::map<BasicBlock*, unsigned> RankMap; public: diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index ff5cdcb74c0..1540767d3b8 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -24,17 +24,17 @@ #include "llvm/Pass.h" #include "llvm/Support/InstVisitor.h" #include "Support/STLExtras.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <algorithm> #include <set> using std::cerr; -static Statistic<> NumInstRemoved("sccp\t\t- Number of instructions removed"); - // InstVal class - This class represents the different lattice values that an // instruction may occupy. It is a simple class with value semantics. // namespace { + Statistic<> NumInstRemoved("sccp", "Number of instructions removed"); + class InstVal { enum { undefined, // This instruction has no known value diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp index 5f04e2fe8f9..3e19aed9499 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp @@ -16,12 +16,12 @@ #include "llvm/Module.h" #include "llvm/Support/CFG.h" #include "llvm/Pass.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include <set> -static Statistic<> NumSimpl("cfgsimplify\t- Number of blocks simplified"); - namespace { + Statistic<> NumSimpl("cfgsimplify", "Number of blocks simplified"); + struct CFGSimplifyPass : public FunctionPass { virtual bool runOnFunction(Function &F); }; |

