summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LCSSA.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2006-05-27 00:31:37 +0000
committerOwen Anderson <resistor@mac.com>2006-05-27 00:31:37 +0000
commitb4e16996f130f4d9d8da31e09d5955b22a81e1d3 (patch)
tree231e5158d4d1d8031324bc6c99bc2e24bcdc3847 /llvm/lib/Transforms/Utils/LCSSA.cpp
parent21dee4e0b2e5ff0ef6b6a72afff5b931e1d21e1e (diff)
downloadbcm5719-llvm-b4e16996f130f4d9d8da31e09d5955b22a81e1d3.tar.gz
bcm5719-llvm-b4e16996f130f4d9d8da31e09d5955b22a81e1d3.zip
A few small clean-ups, and the addition of an LCSSA statistic.
llvm-svn: 28512
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LCSSA.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp
index 43f331d71b2..c8d9487a6d4 100644
--- a/llvm/lib/Transforms/Utils/LCSSA.cpp
+++ b/llvm/lib/Transforms/Utils/LCSSA.cpp
@@ -31,18 +31,22 @@
#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Support/CFG.h"
#include <algorithm>
-#include <set>
#include <vector>
using namespace llvm;
namespace {
+ static Statistic<> NumLCSSA("lcssa", "Number of times LCSSA was applied");
+
class LCSSA : public FunctionPass {
public:
+
+
LoopInfo *LI; // Loop information
DominatorTree *DT; // Dominator Tree for the current Loop...
DominanceFrontier *DF; // Current Dominance Frontier
@@ -51,7 +55,8 @@ namespace {
bool visitSubloop(Loop* L);
/// This transformation requires natural loop information & requires that
- /// loop preheaders be inserted into the CFG...
+ /// loop preheaders be inserted into the CFG. It maintains both of these,
+ /// as well as the CFG. It also requires dominator information.
///
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
@@ -102,6 +107,7 @@ bool LCSSA::visitSubloop(Loop* L) {
for (std::set<Instruction*>::iterator I = AffectedValues.begin(),
E = AffectedValues.end(); I != E; ++I) {
+ ++NumLCSSA; // We are applying the transformation
for (std::vector<BasicBlock*>::iterator BBI = exitBlocks.begin(),
BBE = exitBlocks.end(); BBI != BBE; ++BBI) {
PHINode *phi = new PHINode((*I)->getType(), "lcssa");
OpenPOWER on IntegriCloud