[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h PostDominators.h

2007-06-03 Thread Devang Patel


Changes in directory llvm/include/llvm/Analysis:

Dominators.h updated: 1.83 - 1.84
PostDominators.h updated: 1.21 - 1.22
---
Log message:

s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g



---
Diffs of the changes:  (+35 -35)

 Dominators.h |   64 +++
 PostDominators.h |6 ++---
 2 files changed, 35 insertions(+), 35 deletions(-)


Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.83 
llvm/include/llvm/Analysis/Dominators.h:1.84
--- llvm/include/llvm/Analysis/Dominators.h:1.83Wed May 23 14:55:36 2007
+++ llvm/include/llvm/Analysis/Dominators.h Sun Jun  3 01:26:14 2007
@@ -61,13 +61,13 @@
 ///
 class DominatorTreeBase : public DominatorBase {
 public:
-  class Node;
+  class DomTreeNode;
 protected:
-  std::mapBasicBlock*, Node* Nodes;
+  std::mapBasicBlock*, DomTreeNode* DomTreeNodes;
   void reset();
-  typedef std::mapBasicBlock*, Node* NodeMapType;
+  typedef std::mapBasicBlock*, DomTreeNode* DomTreeNodeMapType;
 
-  Node *RootNode;
+  DomTreeNode *RootNode;
 
   struct InfoRec {
 unsigned Semi;
@@ -88,16 +88,16 @@
   std::mapBasicBlock*, InfoRec Info;
 
 public:
-  class Node {
+  class DomTreeNode {
 friend class DominatorTree;
 friend struct PostDominatorTree;
 friend class DominatorTreeBase;
 BasicBlock *TheBB;
-Node *IDom;
-std::vectorNode* Children;
+DomTreeNode *IDom;
+std::vectorDomTreeNode* Children;
   public:
-typedef std::vectorNode*::iterator iterator;
-typedef std::vectorNode*::const_iterator const_iterator;
+typedef std::vectorDomTreeNode*::iterator iterator;
+typedef std::vectorDomTreeNode*::const_iterator const_iterator;
 
 iterator begin() { return Children.begin(); }
 iterator end()   { return Children.end(); }
@@ -105,14 +105,14 @@
 const_iterator end()   const { return Children.end(); }
 
 inline BasicBlock *getBlock() const { return TheBB; }
-inline Node *getIDom() const { return IDom; }
-inline const std::vectorNode* getChildren() const { return Children; }
+inline DomTreeNode *getIDom() const { return IDom; }
+inline const std::vectorDomTreeNode* getChildren() const { return 
Children; }
 
 /// properlyDominates - Returns true iff this dominates N and this != N.
 /// Note that this is not a constant time operation!
 ///
-bool properlyDominates(const Node *N) const {
-  const Node *IDom;
+bool properlyDominates(const DomTreeNode *N) const {
+  const DomTreeNode *IDom;
   if (this == 0 || N == 0) return false;
   while ((IDom = N-getIDom()) != 0  IDom != this)
 N = IDom;   // Walk up the tree
@@ -122,16 +122,16 @@
 /// dominates - Returns true iff this dominates N.  Note that this is not a
 /// constant time operation!
 ///
-inline bool dominates(const Node *N) const {
+inline bool dominates(const DomTreeNode *N) const {
   if (N == this) return true;  // A node trivially dominates itself.
   return properlyDominates(N);
 }
 
   private:
-inline Node(BasicBlock *BB, Node *iDom) : TheBB(BB), IDom(iDom) {}
-inline Node *addChild(Node *C) { Children.push_back(C); return C; }
+inline DomTreeNode(BasicBlock *BB, DomTreeNode *iDom) : TheBB(BB), 
IDom(iDom) {}
+inline DomTreeNode *addChild(DomTreeNode *C) { Children.push_back(C); 
return C; }
 
-void setIDom(Node *NewIDom);
+void setIDom(DomTreeNode *NewIDom);
   };
 
 public:
@@ -144,12 +144,12 @@
   /// getNode - return the (Post)DominatorTree node for the specified basic
   /// block.  This is the same as using operator[] on this class.
   ///
-  inline Node *getNode(BasicBlock *BB) const {
-NodeMapType::const_iterator i = Nodes.find(BB);
-return (i != Nodes.end()) ? i-second : 0;
+  inline DomTreeNode *getNode(BasicBlock *BB) const {
+DomTreeNodeMapType::const_iterator i = DomTreeNodes.find(BB);
+return (i != DomTreeNodes.end()) ? i-second : 0;
   }
 
-  inline Node *operator[](BasicBlock *BB) const {
+  inline DomTreeNode *operator[](BasicBlock *BB) const {
 return getNode(BB);
   }
 
@@ -160,8 +160,8 @@
   /// post-dominance information must be capable of dealing with this
   /// possibility.
   ///
-  Node *getRootNode() { return RootNode; }
-  const Node *getRootNode() const { return RootNode; }
+  DomTreeNode *getRootNode() { return RootNode; }
+  const DomTreeNode *getRootNode() const { return RootNode; }
 
   
//======//
   // API to update (Post)DominatorTree information based on modifications to
@@ -171,16 +171,16 @@
   /// creates a new node as a child of IDomNode, linking it into the children
   /// list of the immediate dominator.
   ///
-  Node *createNewNode(BasicBlock *BB, Node *IDomNode) {
+  DomTreeNode *createNewNode(BasicBlock *BB, DomTreeNode *IDomNode) {
 assert(getNode(BB) == 0  Block 

[llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/Analysis:

PostDominators.cpp updated: 1.70 - 1.71
---
Log message:

s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g



---
Diffs of the changes:  (+14 -14)

 PostDominators.cpp |   28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)


Index: llvm/lib/Analysis/PostDominators.cpp
diff -u llvm/lib/Analysis/PostDominators.cpp:1.70 
llvm/lib/Analysis/PostDominators.cpp:1.71
--- llvm/lib/Analysis/PostDominators.cpp:1.70   Wed May  2 20:11:53 2007
+++ llvm/lib/Analysis/PostDominators.cppSun Jun  3 01:26:14 2007
@@ -165,19 +165,19 @@
   // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0)
   // which postdominates all real exits if there are multiple exit blocks.
   BasicBlock *Root = Roots.size() == 1 ? Roots[0] : 0;
-  Nodes[Root] = RootNode = new Node(Root, 0);
+  DomTreeNodes[Root] = RootNode = new DomTreeNode(Root, 0);
   
   // Loop over all of the reachable blocks in the function...
   for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
 if (BasicBlock *ImmPostDom = getIDom(I)) {  // Reachable block.
-  Node *BBNode = Nodes[I];
+  DomTreeNode *BBNode = DomTreeNodes[I];
   if (!BBNode) {  // Haven't calculated this node yet?
   // Get or calculate the node for the immediate dominator
-Node *IPDomNode = getNodeForBlock(ImmPostDom);
+DomTreeNode *IPDomNode = getNodeForBlock(ImmPostDom);
 
 // Add a new tree node for this BasicBlock, and link it as a child of
 // IDomNode
-BBNode = IPDomNode-addChild(new Node(I, IPDomNode));
+BBNode = IPDomNode-addChild(new DomTreeNode(I, IPDomNode));
   }
 }
 
@@ -188,18 +188,18 @@
 }
 
 
-DominatorTreeBase::Node *PostDominatorTree::getNodeForBlock(BasicBlock *BB) {
-  Node *BBNode = Nodes[BB];
+DominatorTreeBase::DomTreeNode *PostDominatorTree::getNodeForBlock(BasicBlock 
*BB) {
+  DomTreeNode *BBNode = DomTreeNodes[BB];
   if (BBNode) return BBNode;
   
   // Haven't calculated this node yet?  Get or calculate the node for the
   // immediate postdominator.
   BasicBlock *IPDom = getIDom(BB);
-  Node *IPDomNode = getNodeForBlock(IPDom);
+  DomTreeNode *IPDomNode = getNodeForBlock(IPDom);
   
   // Add a new tree node for this BasicBlock, and link it as a child of
   // IDomNode
-  return BBNode = IPDomNode-addChild(new Node(BB, IPDomNode));
+  return BBNode = IPDomNode-addChild(new DomTreeNode(BB, IPDomNode));
 }
 
 
//===--===//
@@ -215,7 +215,7 @@
 
   // Haven't calculated this node yet?  Get or calculate the node for the
   // immediate dominator.
-  PostDominatorTree::Node *node = getAnalysisPostDominatorTree().getNode(BB);
+  PostDominatorTree::DomTreeNode *node = 
getAnalysisPostDominatorTree().getNode(BB);
 
   // If we are unreachable, we may not have an immediate dominator.
   if (!node)
@@ -245,7 +245,7 @@
 ETNode *BBNode = Nodes[BB];
 if (!BBNode) {  
   ETNode *IDomNode =  NULL;
-  PostDominatorTree::Node *node = DT.getNode(BB);
+  PostDominatorTree::DomTreeNode *node = DT.getNode(BB);
   if (node  node-getIDom())
 IDomNode = getNodeForBlock(node-getIDom()-getBlock());
 
@@ -277,7 +277,7 @@
 
 const DominanceFrontier::DomSetType 
 PostDominanceFrontier::calculate(const PostDominatorTree DT,
- const DominatorTree::Node *Node) {
+ const DominatorTree::DomTreeNode *Node) {
   // Loop over CFG successors to calculate DFlocal[Node]
   BasicBlock *BB = Node-getBlock();
   DomSetType S = Frontiers[BB];   // The new set to fill in...
@@ -287,7 +287,7 @@
 for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB);
  SI != SE; ++SI) {
   // Does Node immediately dominate this predecessor?
-  DominatorTree::Node *SINode = DT[*SI];
+  DominatorTree::DomTreeNode *SINode = DT[*SI];
   if (SINode  SINode-getIDom() != Node)
 S.insert(*SI);
 }
@@ -296,9 +296,9 @@
   // Loop through and visit the nodes that Node immediately dominates (Node's
   // children in the IDomTree)
   //
-  for (PostDominatorTree::Node::const_iterator
+  for (PostDominatorTree::DomTreeNode::const_iterator
  NI = Node-begin(), NE = Node-end(); NI != NE; ++NI) {
-DominatorTree::Node *IDominee = *NI;
+DominatorTree::DomTreeNode *IDominee = *NI;
 const DomSetType ChildDF = calculate(DT, IDominee);
 
 DomSetType::const_iterator CDFI = ChildDF.begin(), CDFE = ChildDF.end();



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/VMCore:

Dominators.cpp updated: 1.102 - 1.103
---
Log message:

s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g



---
Diffs of the changes:  (+27 -27)

 Dominators.cpp |   54 +++---
 1 files changed, 27 insertions(+), 27 deletions(-)


Index: llvm/lib/VMCore/Dominators.cpp
diff -u llvm/lib/VMCore/Dominators.cpp:1.102 
llvm/lib/VMCore/Dominators.cpp:1.103
--- llvm/lib/VMCore/Dominators.cpp:1.102Wed May 23 14:55:36 2007
+++ llvm/lib/VMCore/Dominators.cpp  Sun Jun  3 01:26:14 2007
@@ -234,7 +234,7 @@
 void DominatorTree::calculate(Function F) {
   BasicBlock* Root = Roots[0];
   
-  Nodes[Root] = RootNode = new Node(Root, 0); // Add a node for the root...
+  DomTreeNodes[Root] = RootNode = new DomTreeNode(Root, 0); // Add a node for 
the root...
 
   Vertex.push_back(0);
 
@@ -282,14 +282,14 @@
   // Loop over all of the reachable blocks in the function...
   for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
 if (BasicBlock *ImmDom = getIDom(I)) {  // Reachable block.
-  Node *BBNode = Nodes[I];
+  DomTreeNode *BBNode = DomTreeNodes[I];
   if (!BBNode) {  // Haven't calculated this node yet?
 // Get or calculate the node for the immediate dominator
-Node *IDomNode = getNodeForBlock(ImmDom);
+DomTreeNode *IDomNode = getNodeForBlock(ImmDom);
 
 // Add a new tree node for this BasicBlock, and link it as a child of
 // IDomNode
-BBNode = IDomNode-addChild(new Node(I, IDomNode));
+BBNode = IDomNode-addChild(new DomTreeNode(I, IDomNode));
   }
 }
 
@@ -302,19 +302,19 @@
 // DominatorTreeBase::reset - Free all of the tree node memory.
 //
 void DominatorTreeBase::reset() {
-  for (NodeMapType::iterator I = Nodes.begin(), E = Nodes.end(); I != E; ++I)
+  for (DomTreeNodeMapType::iterator I = DomTreeNodes.begin(), E = 
DomTreeNodes.end(); I != E; ++I)
 delete I-second;
-  Nodes.clear();
+  DomTreeNodes.clear();
   IDoms.clear();
   Roots.clear();
   Vertex.clear();
   RootNode = 0;
 }
 
-void DominatorTreeBase::Node::setIDom(Node *NewIDom) {
+void DominatorTreeBase::DomTreeNode::setIDom(DomTreeNode *NewIDom) {
   assert(IDom  No immediate dominator?);
   if (IDom != NewIDom) {
-std::vectorNode*::iterator I =
+std::vectorDomTreeNode*::iterator I =
   std::find(IDom-Children.begin(), IDom-Children.end(), this);
 assert(I != IDom-Children.end() 
Not in immediate dominator children set!);
@@ -327,22 +327,22 @@
   }
 }
 
-DominatorTreeBase::Node *DominatorTree::getNodeForBlock(BasicBlock *BB) {
-  Node *BBNode = Nodes[BB];
+DominatorTreeBase::DomTreeNode *DominatorTree::getNodeForBlock(BasicBlock *BB) 
{
+  DomTreeNode *BBNode = DomTreeNodes[BB];
   if (BBNode) return BBNode;
 
   // Haven't calculated this node yet?  Get or calculate the node for the
   // immediate dominator.
   BasicBlock *IDom = getIDom(BB);
-  Node *IDomNode = getNodeForBlock(IDom);
+  DomTreeNode *IDomNode = getNodeForBlock(IDom);
 
   // Add a new tree node for this BasicBlock, and link it as a child of
   // IDomNode
-  return BBNode = IDomNode-addChild(new Node(BB, IDomNode));
+  return BBNode = IDomNode-addChild(new DomTreeNode(BB, IDomNode));
 }
 
 static std::ostream operator(std::ostream o,
-const DominatorTreeBase::Node *Node) {
+const DominatorTreeBase::DomTreeNode *Node) {
   if (Node-getBlock())
 WriteAsOperand(o, Node-getBlock(), false);
   else
@@ -350,10 +350,10 @@
   return o  \n;
 }
 
-static void PrintDomTree(const DominatorTreeBase::Node *N, std::ostream o,
+static void PrintDomTree(const DominatorTreeBase::DomTreeNode *N, std::ostream 
o,
  unsigned Lev) {
   o  std::string(2*Lev, ' ')  [  Lev  ]   N;
-  for (DominatorTreeBase::Node::const_iterator I = N-begin(), E = N-end();
+  for (DominatorTreeBase::DomTreeNode::const_iterator I = N-begin(), E = 
N-end();
I != E; ++I)
 PrintDomTree(*I, o, Lev+1);
 }
@@ -387,19 +387,19 @@
   class DFCalculateWorkObject {
   public:
 DFCalculateWorkObject(BasicBlock *B, BasicBlock *P, 
-  const DominatorTree::Node *N,
-  const DominatorTree::Node *PN)
-: currentBB(B), parentBB(P), Node(N), parentNode(PN) {}
+  const DominatorTree::DomTreeNode *N,
+  const DominatorTree::DomTreeNode *PN)
+: currentBB(B), parentBB(P), DomTreeNode(N), parentNode(PN) {}
 BasicBlock *currentBB;
 BasicBlock *parentBB;
-const DominatorTree::Node *Node;
-const DominatorTree::Node *parentNode;
+const DominatorTree::DomTreeNode *DomTreeNode;
+const DominatorTree::DomTreeNode *parentNode;
   };
 }
 
 const DominanceFrontier::DomSetType 
 DominanceFrontier::calculate(const DominatorTree DT,
- const DominatorTree::Node *Node) {
+

[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp GCSE.cpp GVNPRE.cpp LICM.cpp PredicateSimplifier.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.110 - 1.111
GCSE.cpp updated: 1.57 - 1.58
GVNPRE.cpp updated: 1.12 - 1.13
LICM.cpp updated: 1.102 - 1.103
PredicateSimplifier.cpp updated: 1.75 - 1.76
---
Log message:

s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g



---
Diffs of the changes:  (+26 -26)

 ADCE.cpp|4 ++--
 GCSE.cpp|2 +-
 GVNPRE.cpp  |8 
 LICM.cpp|   16 
 PredicateSimplifier.cpp |   22 +++---
 5 files changed, 26 insertions(+), 26 deletions(-)


Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.110 
llvm/lib/Transforms/Scalar/ADCE.cpp:1.111
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.110   Sun May  6 08:37:16 2007
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Sun Jun  3 01:26:14 2007
@@ -387,8 +387,8 @@
   // postdominator that is alive, and the last postdominator that is
   // dead...
   //
-  PostDominatorTree::Node *LastNode = DT[TI-getSuccessor(i)];
-  PostDominatorTree::Node *NextNode = 0;
+  PostDominatorTree::DomTreeNode *LastNode = DT[TI-getSuccessor(i)];
+  PostDominatorTree::DomTreeNode *NextNode = 0;
 
   if (LastNode) {
 NextNode = LastNode-getIDom();


Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.57 
llvm/lib/Transforms/Scalar/GCSE.cpp:1.58
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.57Sun May  6 08:37:16 2007
+++ llvm/lib/Transforms/Scalar/GCSE.cpp Sun Jun  3 01:26:14 2007
@@ -94,7 +94,7 @@
 
   // Traverse the CFG of the function in dominator order, so that we see each
   // instruction after we see its operands.
-  for (df_iteratorDominatorTree::Node* DI = df_begin(DT.getRootNode()),
+  for (df_iteratorDominatorTree::DomTreeNode* DI = 
df_begin(DT.getRootNode()),
  E = df_end(DT.getRootNode()); DI != E; ++DI) {
 BasicBlock *BB = DI-getBlock();
 


Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.12 
llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.13
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.12  Sun Jun  3 00:58:25 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp   Sun Jun  3 01:26:14 2007
@@ -87,7 +87,7 @@
 // For a given block, calculate the generated expressions, temporaries,
 // and the AVAIL_OUT set
 void CalculateAvailOut(ValueTable VN, std::setValue*, ExprLT MS,
-   DominatorTree::Node* DI,
+   DominatorTree::DomTreeNode* DI,
std::setValue*, ExprLT currExps,
std::setPHINode* currPhis,
std::setValue*, ExprLT currTemps,
@@ -262,7 +262,7 @@
 }
 
 void GVNPRE::CalculateAvailOut(GVNPRE::ValueTable VN, std::setValue*, 
ExprLT MS,
-   DominatorTree::Node* DI,
+   DominatorTree::DomTreeNode* DI,
std::setValue*, ExprLT currExps,
std::setPHINode* currPhis,
std::setValue*, ExprLT currTemps,
@@ -324,7 +324,7 @@
   // First Phase of BuildSets - calculate AVAIL_OUT
   
   // Top-down walk of the dominator tree
-  for (df_iteratorDominatorTree::Node* DI = df_begin(DT.getRootNode()),
+  for (df_iteratorDominatorTree::DomTreeNode* DI = 
df_begin(DT.getRootNode()),
  E = df_end(DT.getRootNode()); DI != E; ++DI) {
 
 // Get the sets to update for this block
@@ -350,7 +350,7 @@
 std::setValue*, ExprLT anticOut;
 
 // Top-down walk of the postdominator tree
-for (df_iteratorPostDominatorTree::Node* PDI = 
+for (df_iteratorPostDominatorTree::DomTreeNode* PDI = 
  df_begin(PDT.getRootNode()), E = df_end(DT.getRootNode());
  PDI != E; ++PDI) {
   BasicBlock* BB = PDI-getBlock();


Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.102 
llvm/lib/Transforms/Scalar/LICM.cpp:1.103
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.102   Fri Jun  1 17:15:31 2007
+++ llvm/lib/Transforms/Scalar/LICM.cpp Sun Jun  3 01:26:14 2007
@@ -107,7 +107,7 @@
 /// visit uses before definitions, allowing us to sink a loop body in one
 /// pass without iteration.
 ///
-void SinkRegion(DominatorTree::Node *N);
+void SinkRegion(DominatorTree::DomTreeNode *N);
 
 /// HoistRegion - Walk the specified region of the CFG (defined by all
 /// blocks dominated by the specified block, and that are in the current
@@ -115,7 +115,7 @@
 /// visit definitions before uses, allowing us to hoist a loop body in one
 /// pass without iteration.
 ///
-void HoistRegion(DominatorTree::Node *N);
+void HoistRegion(DominatorTree::DomTreeNode *N);
 
 /// inSubLoop - Little predicate that returns true if the specified basic
 /// block is in a subloop of the current one, not the current one itself.
@@ -140,8 +140,8 @@
   if 

[llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LCSSA.cpp LoopSimplify.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Utils:

BreakCriticalEdges.cpp updated: 1.48 - 1.49
LCSSA.cpp updated: 1.43 - 1.44
LoopSimplify.cpp updated: 1.96 - 1.97
---
Log message:

s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g



---
Diffs of the changes:  (+15 -15)

 BreakCriticalEdges.cpp |8 
 LCSSA.cpp  |   16 
 LoopSimplify.cpp   |6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)


Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.48 
llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.49
--- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.48   Sun May  6 
08:37:16 2007
+++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cppSun Jun  3 01:26:14 2007
@@ -203,20 +203,20 @@
   
   // Should we update DominatorTree information?
   if (DominatorTree *DT = P-getAnalysisToUpdateDominatorTree()) {
-DominatorTree::Node *TINode = DT-getNode(TIBB);
+DominatorTree::DomTreeNode *TINode = DT-getNode(TIBB);
 
 // The new block is not the immediate dominator for any other nodes, but
 // TINode is the immediate dominator for the new node.
 //
 if (TINode) {   // Don't break unreachable code!
-  DominatorTree::Node *NewBBNode = DT-createNewNode(NewBB, TINode);
-  DominatorTree::Node *DestBBNode = 0;
+  DominatorTree::DomTreeNode *NewBBNode = DT-createNewNode(NewBB, TINode);
+  DominatorTree::DomTreeNode *DestBBNode = 0;
  
   // If NewBBDominatesDestBB hasn't been computed yet, do so with DT.
   if (!OtherPreds.empty()) {
 DestBBNode = DT-getNode(DestBB);
 while (!OtherPreds.empty()  NewBBDominatesDestBB) {
-  if (DominatorTree::Node *OPNode = DT-getNode(OtherPreds.back()))
+  if (DominatorTree::DomTreeNode *OPNode = 
DT-getNode(OtherPreds.back()))
 NewBBDominatesDestBB = DestBBNode-dominates(OPNode);
   OtherPreds.pop_back();
 }


Index: llvm/lib/Transforms/Utils/LCSSA.cpp
diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.43 
llvm/lib/Transforms/Utils/LCSSA.cpp:1.44
--- llvm/lib/Transforms/Utils/LCSSA.cpp:1.43Fri May 11 16:10:54 2007
+++ llvm/lib/Transforms/Utils/LCSSA.cpp Sun Jun  3 01:26:14 2007
@@ -75,8 +75,8 @@
 void getLoopValuesUsedOutsideLoop(Loop *L,
   SetVectorInstruction* AffectedValues);
 
-Value *GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst,
-std::mapDominatorTree::Node*, Value* Phis);
+Value *GetValueForBlock(DominatorTree::DomTreeNode *BB, Instruction 
*OrigInst,
+std::mapDominatorTree::DomTreeNode*, Value* 
Phis);
 
 /// inLoop - returns true if the given block is within the current loop
 const bool inLoop(BasicBlock* B) {
@@ -146,16 +146,16 @@
   ++NumLCSSA; // We are applying the transformation
 
   // Keep track of the blocks that have the value available already.
-  std::mapDominatorTree::Node*, Value* Phis;
+  std::mapDominatorTree::DomTreeNode*, Value* Phis;
 
-  DominatorTree::Node *InstrNode = DT-getNode(Instr-getParent());
+  DominatorTree::DomTreeNode *InstrNode = DT-getNode(Instr-getParent());
 
   // Insert the LCSSA phi's into the exit blocks (dominated by the value), and
   // add them to the Phi's map.
   for (std::vectorBasicBlock*::const_iterator BBI = exitBlocks.begin(),
   BBE = exitBlocks.end(); BBI != BBE; ++BBI) {
 BasicBlock *BB = *BBI;
-DominatorTree::Node *ExitBBNode = DT-getNode(BB);
+DominatorTree::DomTreeNode *ExitBBNode = DT-getNode(BB);
 Value *Phi = Phis[ExitBBNode];
 if (!Phi  InstrNode-dominates(ExitBBNode)) {
   PHINode *PN = new PHINode(Instr-getType(), Instr-getName()+.lcssa,
@@ -229,8 +229,8 @@
 
 /// GetValueForBlock - Get the value to use within the specified basic block.
 /// available values are in Phis.
-Value *LCSSA::GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst,
-   std::mapDominatorTree::Node*, Value* Phis) {
+Value *LCSSA::GetValueForBlock(DominatorTree::DomTreeNode *BB, Instruction 
*OrigInst,
+   std::mapDominatorTree::DomTreeNode*, Value* 
Phis) {
   // If there is no dominator info for this BB, it is unreachable.
   if (BB == 0)
 return UndefValue::get(OrigInst-getType());
@@ -239,7 +239,7 @@
   Value *V = Phis[BB];
   if (V) return V;
 
-  DominatorTree::Node *IDom = BB-getIDom();
+  DominatorTree::DomTreeNode *IDom = BB-getIDom();
 
   // Otherwise, there are two cases: we either have to insert a PHI node or we
   // don't.  We need to insert a PHI node if this block is not dominated by one


Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.96 
llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.97
--- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.96 Sun May  6 08:37:16 2007
+++ 

[llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp

2007-06-03 Thread Anton Korobeynikov


Changes in directory llvm/lib/ExecutionEngine:

ExecutionEngine.cpp updated: 1.115 - 1.116
---
Log message:

Check arguments  return types of main(). Abort in case of no match.


---
Diffs of the changes:  (+32 -0)

 ExecutionEngine.cpp |   32 
 1 files changed, 32 insertions(+)


Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.115 
llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.116
--- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.115  Thu May 24 10:03:18 2007
+++ llvm/lib/ExecutionEngine/ExecutionEngine.cppSun Jun  3 14:17:35 2007
@@ -231,7 +231,39 @@
   std::vectorGenericValue GVArgs;
   GenericValue GVArgc;
   GVArgc.IntVal = APInt(32, argv.size());
+
+  // Check main() type
   unsigned NumArgs = Fn-getFunctionType()-getNumParams();
+  const FunctionType *FTy = Fn-getFunctionType();
+  const Type* PPInt8Ty = PointerType::get(PointerType::get(Type::Int8Ty));
+  switch (NumArgs) {
+  case 3:
+   if (FTy-getParamType(2) != PPInt8Ty) {
+ cerr  Invalid type for third argument of main() supplied\n;
+ abort();
+   }
+  case 2:
+   if (FTy-getParamType(1) != PPInt8Ty) {
+ cerr  Invalid type for second argument of main() supplied\n;
+ abort();
+   }
+  case 1:
+   if (FTy-getParamType(0) != Type::Int32Ty) {
+ cerr  Invalid type for first argument of main() supplied\n;
+ abort();
+   }
+  case 0:
+   if (FTy-getReturnType() != Type::Int32Ty 
+   FTy-getReturnType() != Type::VoidTy) {
+ cerr  Invalid return type of main() supplied\n;
+ abort();
+   }
+   break;
+  default:
+   cerr  Invalid number of arguments of main() supplied\n;
+   abort();
+  }
+  
   if (NumArgs) {
 GVArgs.push_back(GVArgc); // Arg #0 = argc.
 if (NumArgs  1) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp

2007-06-03 Thread Anton Korobeynikov


Changes in directory llvm/lib/ExecutionEngine:

ExecutionEngine.cpp updated: 1.116 - 1.117
---
Log message:

Add comments to fallsthrough cases. Also, this fixes PR1492: 
http://llvm.org/PR1492 


---
Diffs of the changes:  (+3 -0)

 ExecutionEngine.cpp |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.116 
llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.117
--- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.116  Sun Jun  3 14:17:35 2007
+++ llvm/lib/ExecutionEngine/ExecutionEngine.cppSun Jun  3 14:20:49 2007
@@ -242,16 +242,19 @@
  cerr  Invalid type for third argument of main() supplied\n;
  abort();
}
+   // FALLS THROUGH
   case 2:
if (FTy-getParamType(1) != PPInt8Ty) {
  cerr  Invalid type for second argument of main() supplied\n;
  abort();
}
+   // FALLS THROUGH
   case 1:
if (FTy-getParamType(0) != Type::Int32Ty) {
  cerr  Invalid type for first argument of main() supplied\n;
  abort();
}
+   // FALLS THROUGH
   case 0:
if (FTy-getReturnType() != Type::Int32Ty 
FTy-getReturnType() != Type::VoidTy) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/GVNPRE.cpp

2007-06-03 Thread Owen Anderson


Changes in directory llvm/lib/Transforms/Scalar:

GVNPRE.cpp updated: 1.13 - 1.14
---
Log message:

Don't use the custom comparator where it's not necessary.


---
Diffs of the changes:  (+22 -13)

 GVNPRE.cpp |   35 ++-
 1 files changed, 22 insertions(+), 13 deletions(-)


Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.13 
llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.14
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.13  Sun Jun  3 01:26:14 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp   Sun Jun  3 17:02:14 2007
@@ -73,7 +73,8 @@
   
 // Helper fuctions
 // FIXME: eliminate or document these better
-void dump(ValueTable VN, std::setValue*, ExprLT s);
+void dump(ValueTable VN, std::setValue* s);
+void dump_unique(ValueTable VN, std::setValue*, ExprLT s);
 void clean(ValueTable VN, std::setValue*, ExprLT set);
 bool add(ValueTable VN, std::setValue*, ExprLT MS, Value* V);
 Value* find_leader(ValueTable VN, std::setValue*, ExprLT vals, uint32_t 
v);
@@ -90,7 +91,7 @@
DominatorTree::DomTreeNode* DI,
std::setValue*, ExprLT currExps,
std::setPHINode* currPhis,
-   std::setValue*, ExprLT currTemps,
+   std::setValue* currTemps,
std::setValue*, ExprLT currAvail,
std::mapBasicBlock*, std::setValue*, ExprLT  
availOut);
   
@@ -250,11 +251,19 @@
   }
 }
 
-void GVNPRE::dump(GVNPRE::ValueTable VN, std::setValue*, ExprLT s) {
-  std::vectorValue* sorted;
-  topo_sort(VN, s, sorted);
+
+void GVNPRE::dump(GVNPRE::ValueTable VN, std::setValue* s) {
   DOUT  { ;
-  for (std::vectorValue*::iterator I = sorted.begin(), E = sorted.end();
+  for (std::setValue*::iterator I = s.begin(), E = s.end();
+   I != E; ++I) {
+DEBUG((*I)-dump());
+  }
+  DOUT  }\n\n;
+}
+
+void GVNPRE::dump_unique(GVNPRE::ValueTable VN, std::setValue*, ExprLT s) {
+  DOUT  { ;
+  for (std::setValue*::iterator I = s.begin(), E = s.end();
I != E; ++I) {
 DEBUG((*I)-dump());
   }
@@ -265,7 +274,7 @@
DominatorTree::DomTreeNode* DI,
std::setValue*, ExprLT currExps,
std::setPHINode* currPhis,
-   std::setValue*, ExprLT currTemps,
+   std::setValue* currTemps,
std::setValue*, ExprLT currAvail,
std::mapBasicBlock*, std::setValue*, ExprLT  
availOut) {
   
@@ -297,7 +306,7 @@
   currExps.insert(BO);
   
   currTemps.insert(BO);
-
+  
 // Handle unsupported ops
 } else if (!BI-isTerminator()){
   add(VN, MS, BI);
@@ -315,7 +324,7 @@
 
   std::mapBasicBlock*, std::setValue*, ExprLT  generatedExpressions;
   std::mapBasicBlock*, std::setPHINode*  generatedPhis;
-  std::mapBasicBlock*, std::setValue*, ExprLT  generatedTemporaries;
+  std::mapBasicBlock*, std::setValue*  generatedTemporaries;
   std::mapBasicBlock*, std::setValue*, ExprLT  availableOut;
   std::mapBasicBlock*, std::setValue*, ExprLT  anticipatedIn;
   
@@ -330,7 +339,7 @@
 // Get the sets to update for this block
 std::setValue*, ExprLT currExps = generatedExpressions[DI-getBlock()];
 std::setPHINode* currPhis = generatedPhis[DI-getBlock()];
-std::setValue*, ExprLT currTemps = generatedTemporaries[DI-getBlock()];
+std::setValue* currTemps = generatedTemporaries[DI-getBlock()];
 std::setValue*, ExprLT currAvail = availableOut[DI-getBlock()]; 
 
 CalculateAvailOut(VN, maximalSet, *DI, currExps, currPhis,
@@ -423,15 +432,15 @@
 DOUT  \n;
 
 DOUT  EXP_GEN: ;
-dump(VN, generatedExpressions[I]);
+dump_unique(VN, generatedExpressions[I]);
 DOUT  \n;
 
 DOUT  ANTIC_IN: ;
-dump(VN, anticipatedIn[I]);
+dump_unique(VN, anticipatedIn[I]);
 DOUT  \n;
 
 DOUT  AVAIL_OUT: ;
-dump(VN, availableOut[I]);
+dump_unique(VN, availableOut[I]);
 DOUT  \n;
   }
   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h PostDominators.h

2007-06-03 Thread Devang Patel


Changes in directory llvm/include/llvm/Analysis:

Dominators.h updated: 1.84 - 1.85
PostDominators.h updated: 1.22 - 1.23
---
Log message:

s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g


---
Diffs of the changes:  (+57 -53)

 Dominators.h |  106 ---
 PostDominators.h |4 +-
 2 files changed, 57 insertions(+), 53 deletions(-)


Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.84 
llvm/include/llvm/Analysis/Dominators.h:1.85
--- llvm/include/llvm/Analysis/Dominators.h:1.84Sun Jun  3 01:26:14 2007
+++ llvm/include/llvm/Analysis/Dominators.h Sun Jun  3 19:32:21 2007
@@ -56,12 +56,61 @@
   bool isPostDominator() const { return IsPostDominators; }
 };
 
+
+//===--===//
+// DomTreeNode - Dominator Tree Node
+
+class DomTreeNode {
+  friend class DominatorTree;
+  friend struct PostDominatorTree;
+  friend class DominatorTreeBase;
+  BasicBlock *TheBB;
+  DomTreeNode *IDom;
+  std::vectorDomTreeNode* Children;
+public:
+  typedef std::vectorDomTreeNode*::iterator iterator;
+  typedef std::vectorDomTreeNode*::const_iterator const_iterator;
+  
+  iterator begin() { return Children.begin(); }
+  iterator end()   { return Children.end(); }
+  const_iterator begin() const { return Children.begin(); }
+  const_iterator end()   const { return Children.end(); }
+  
+  inline BasicBlock *getBlock() const { return TheBB; }
+  inline DomTreeNode *getIDom() const { return IDom; }
+  inline const std::vectorDomTreeNode* getChildren() const { return 
Children; }
+  
+  /// properlyDominates - Returns true iff this dominates N and this != N.
+  /// Note that this is not a constant time operation!
+  ///
+  bool properlyDominates(const DomTreeNode *N) const {
+const DomTreeNode *IDom;
+if (this == 0 || N == 0) return false;
+while ((IDom = N-getIDom()) != 0  IDom != this)
+  N = IDom;   // Walk up the tree
+return IDom != 0;
+  }
+  
+  /// dominates - Returns true iff this dominates N.  Note that this is not a
+  /// constant time operation!
+  ///
+  inline bool dominates(const DomTreeNode *N) const {
+if (N == this) return true;  // A node trivially dominates itself.
+return properlyDominates(N);
+  }
+  
+private:
+  inline DomTreeNode(BasicBlock *BB, DomTreeNode *iDom) : TheBB(BB), 
IDom(iDom) {}
+  inline DomTreeNode *addChild(DomTreeNode *C) { Children.push_back(C); return 
C; }
+
+  void setIDom(DomTreeNode *NewIDom);
+};
+
 
//===--===//
 /// DominatorTree - Calculate the immediate dominator tree for a function.
 ///
 class DominatorTreeBase : public DominatorBase {
 public:
-  class DomTreeNode;
 protected:
   std::mapBasicBlock*, DomTreeNode* DomTreeNodes;
   void reset();
@@ -88,52 +137,6 @@
   std::mapBasicBlock*, InfoRec Info;
 
 public:
-  class DomTreeNode {
-friend class DominatorTree;
-friend struct PostDominatorTree;
-friend class DominatorTreeBase;
-BasicBlock *TheBB;
-DomTreeNode *IDom;
-std::vectorDomTreeNode* Children;
-  public:
-typedef std::vectorDomTreeNode*::iterator iterator;
-typedef std::vectorDomTreeNode*::const_iterator const_iterator;
-
-iterator begin() { return Children.begin(); }
-iterator end()   { return Children.end(); }
-const_iterator begin() const { return Children.begin(); }
-const_iterator end()   const { return Children.end(); }
-
-inline BasicBlock *getBlock() const { return TheBB; }
-inline DomTreeNode *getIDom() const { return IDom; }
-inline const std::vectorDomTreeNode* getChildren() const { return 
Children; }
-
-/// properlyDominates - Returns true iff this dominates N and this != N.
-/// Note that this is not a constant time operation!
-///
-bool properlyDominates(const DomTreeNode *N) const {
-  const DomTreeNode *IDom;
-  if (this == 0 || N == 0) return false;
-  while ((IDom = N-getIDom()) != 0  IDom != this)
-N = IDom;   // Walk up the tree
-  return IDom != 0;
-}
-
-/// dominates - Returns true iff this dominates N.  Note that this is not a
-/// constant time operation!
-///
-inline bool dominates(const DomTreeNode *N) const {
-  if (N == this) return true;  // A node trivially dominates itself.
-  return properlyDominates(N);
-}
-
-  private:
-inline DomTreeNode(BasicBlock *BB, DomTreeNode *iDom) : TheBB(BB), 
IDom(iDom) {}
-inline DomTreeNode *addChild(DomTreeNode *C) { Children.push_back(C); 
return C; }
-
-void setIDom(DomTreeNode *NewIDom);
-  };
-
 public:
   DominatorTreeBase(intptr_t ID, bool isPostDom) 
 : DominatorBase(ID, isPostDom) {}
@@ -238,8 +241,8 @@
 /// DominatorTree GraphTraits specialization so the DominatorTree can be
 /// iterable by generic graph iterators.
 

[llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/Analysis:

PostDominators.cpp updated: 1.71 - 1.72
---
Log message:

s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g


---
Diffs of the changes:  (+7 -7)

 PostDominators.cpp |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


Index: llvm/lib/Analysis/PostDominators.cpp
diff -u llvm/lib/Analysis/PostDominators.cpp:1.71 
llvm/lib/Analysis/PostDominators.cpp:1.72
--- llvm/lib/Analysis/PostDominators.cpp:1.71   Sun Jun  3 01:26:14 2007
+++ llvm/lib/Analysis/PostDominators.cppSun Jun  3 19:32:21 2007
@@ -188,7 +188,7 @@
 }
 
 
-DominatorTreeBase::DomTreeNode *PostDominatorTree::getNodeForBlock(BasicBlock 
*BB) {
+DomTreeNode *PostDominatorTree::getNodeForBlock(BasicBlock *BB) {
   DomTreeNode *BBNode = DomTreeNodes[BB];
   if (BBNode) return BBNode;
   
@@ -215,7 +215,7 @@
 
   // Haven't calculated this node yet?  Get or calculate the node for the
   // immediate dominator.
-  PostDominatorTree::DomTreeNode *node = 
getAnalysisPostDominatorTree().getNode(BB);
+  DomTreeNode *node = getAnalysisPostDominatorTree().getNode(BB);
 
   // If we are unreachable, we may not have an immediate dominator.
   if (!node)
@@ -245,7 +245,7 @@
 ETNode *BBNode = Nodes[BB];
 if (!BBNode) {  
   ETNode *IDomNode =  NULL;
-  PostDominatorTree::DomTreeNode *node = DT.getNode(BB);
+  DomTreeNode *node = DT.getNode(BB);
   if (node  node-getIDom())
 IDomNode = getNodeForBlock(node-getIDom()-getBlock());
 
@@ -277,7 +277,7 @@
 
 const DominanceFrontier::DomSetType 
 PostDominanceFrontier::calculate(const PostDominatorTree DT,
- const DominatorTree::DomTreeNode *Node) {
+ const DomTreeNode *Node) {
   // Loop over CFG successors to calculate DFlocal[Node]
   BasicBlock *BB = Node-getBlock();
   DomSetType S = Frontiers[BB];   // The new set to fill in...
@@ -287,7 +287,7 @@
 for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB);
  SI != SE; ++SI) {
   // Does Node immediately dominate this predecessor?
-  DominatorTree::DomTreeNode *SINode = DT[*SI];
+  DomTreeNode *SINode = DT[*SI];
   if (SINode  SINode-getIDom() != Node)
 S.insert(*SI);
 }
@@ -296,9 +296,9 @@
   // Loop through and visit the nodes that Node immediately dominates (Node's
   // children in the IDomTree)
   //
-  for (PostDominatorTree::DomTreeNode::const_iterator
+  for (DomTreeNode::const_iterator
  NI = Node-begin(), NE = Node-end(); NI != NE; ++NI) {
-DominatorTree::DomTreeNode *IDominee = *NI;
+DomTreeNode *IDominee = *NI;
 const DomSetType ChildDF = calculate(DT, IDominee);
 
 DomSetType::const_iterator CDFI = ChildDF.begin(), CDFE = ChildDF.end();



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/VMCore:

Dominators.cpp updated: 1.103 - 1.104
---
Log message:

s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g


---
Diffs of the changes:  (+17 -17)

 Dominators.cpp |   34 +-
 1 files changed, 17 insertions(+), 17 deletions(-)


Index: llvm/lib/VMCore/Dominators.cpp
diff -u llvm/lib/VMCore/Dominators.cpp:1.103 
llvm/lib/VMCore/Dominators.cpp:1.104
--- llvm/lib/VMCore/Dominators.cpp:1.103Sun Jun  3 01:26:14 2007
+++ llvm/lib/VMCore/Dominators.cpp  Sun Jun  3 19:32:22 2007
@@ -311,7 +311,7 @@
   RootNode = 0;
 }
 
-void DominatorTreeBase::DomTreeNode::setIDom(DomTreeNode *NewIDom) {
+void DomTreeNode::setIDom(DomTreeNode *NewIDom) {
   assert(IDom  No immediate dominator?);
   if (IDom != NewIDom) {
 std::vectorDomTreeNode*::iterator I =
@@ -327,7 +327,7 @@
   }
 }
 
-DominatorTreeBase::DomTreeNode *DominatorTree::getNodeForBlock(BasicBlock *BB) 
{
+DomTreeNode *DominatorTree::getNodeForBlock(BasicBlock *BB) {
   DomTreeNode *BBNode = DomTreeNodes[BB];
   if (BBNode) return BBNode;
 
@@ -342,7 +342,7 @@
 }
 
 static std::ostream operator(std::ostream o,
-const DominatorTreeBase::DomTreeNode *Node) {
+const DomTreeNode *Node) {
   if (Node-getBlock())
 WriteAsOperand(o, Node-getBlock(), false);
   else
@@ -350,10 +350,10 @@
   return o  \n;
 }
 
-static void PrintDomTree(const DominatorTreeBase::DomTreeNode *N, std::ostream 
o,
+static void PrintDomTree(const DomTreeNode *N, std::ostream o,
  unsigned Lev) {
   o  std::string(2*Lev, ' ')  [  Lev  ]   N;
-  for (DominatorTreeBase::DomTreeNode::const_iterator I = N-begin(), E = 
N-end();
+  for (DomTreeNode::const_iterator I = N-begin(), E = N-end();
I != E; ++I)
 PrintDomTree(*I, o, Lev+1);
 }
@@ -387,19 +387,19 @@
   class DFCalculateWorkObject {
   public:
 DFCalculateWorkObject(BasicBlock *B, BasicBlock *P, 
-  const DominatorTree::DomTreeNode *N,
-  const DominatorTree::DomTreeNode *PN)
-: currentBB(B), parentBB(P), DomTreeNode(N), parentNode(PN) {}
+  const DomTreeNode *N,
+  const DomTreeNode *PN)
+: currentBB(B), parentBB(P), Node(N), parentNode(PN) {}
 BasicBlock *currentBB;
 BasicBlock *parentBB;
-const DominatorTree::DomTreeNode *DomTreeNode;
-const DominatorTree::DomTreeNode *parentNode;
+const DomTreeNode *Node;
+const DomTreeNode *parentNode;
   };
 }
 
 const DominanceFrontier::DomSetType 
 DominanceFrontier::calculate(const DominatorTree DT,
- const DominatorTree::DomTreeNode *Node) {
+ const DomTreeNode *Node) {
   BasicBlock *BB = Node-getBlock();
   DomSetType *Result = NULL;
 
@@ -413,8 +413,8 @@
 
 BasicBlock *currentBB = currentW-currentBB;
 BasicBlock *parentBB = currentW-parentBB;
-const DominatorTree::DomTreeNode *currentNode = currentW-DomTreeNode;
-const DominatorTree::DomTreeNode *parentNode = currentW-parentNode;
+const DomTreeNode *currentNode = currentW-Node;
+const DomTreeNode *parentNode = currentW-parentNode;
 assert (currentBB  Invalid work object. Missing current Basic Block);
 assert (currentNode  Invalid work object. Missing current Node);
 DomSetType S = Frontiers[currentBB];
@@ -436,9 +436,9 @@
 // Loop through and visit the nodes that Node immediately dominates (Node's
 // children in the IDomTree)
 bool visitChild = false;
-for (DominatorTree::DomTreeNode::const_iterator NI = currentNode-begin(), 
+for (DomTreeNode::const_iterator NI = currentNode-begin(), 
NE = currentNode-end(); NI != NE; ++NI) {
-  DominatorTree::DomTreeNode *IDominee = *NI;
+  DomTreeNode *IDominee = *NI;
   BasicBlock *childBB = IDominee-getBlock();
   if (visited.count(childBB) == 0) {
 workList.push_back(DFCalculateWorkObject(childBB, currentBB,
@@ -927,7 +927,7 @@
 
   // Haven't calculated this node yet?  Get or calculate the node for the
   // immediate dominator.
-  DominatorTree::DomTreeNode *node= getAnalysisDominatorTree().getNode(BB);
+  DomTreeNode *node= getAnalysisDominatorTree().getNode(BB);
 
   // If we are unreachable, we may not have an immediate dominator.
   if (!node || !node-getIDom())
@@ -951,7 +951,7 @@
   Function *F = Root-getParent();
   // Loop over all of the reachable blocks in the function...
   for (Function::iterator I = F-begin(), E = F-end(); I != E; ++I) {
-DominatorTree::DomTreeNode* node = DT.getNode(I);
+DomTreeNode* node = DT.getNode(I);
 if (node  node-getIDom()) {  // Reachable block.
   BasicBlock* ImmDom = node-getIDom()-getBlock();
   ETNode *BBNode = Nodes[I];



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu

[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp GCSE.cpp GVNPRE.cpp LICM.cpp PredicateSimplifier.cpp

2007-06-03 Thread Devang Patel


Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.111 - 1.112
GCSE.cpp updated: 1.58 - 1.59
GVNPRE.cpp updated: 1.14 - 1.15
LICM.cpp updated: 1.103 - 1.104
PredicateSimplifier.cpp updated: 1.76 - 1.77
---
Log message:

s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g


---
Diffs of the changes:  (+26 -26)

 ADCE.cpp|4 ++--
 GCSE.cpp|2 +-
 GVNPRE.cpp  |8 
 LICM.cpp|   16 
 PredicateSimplifier.cpp |   22 +++---
 5 files changed, 26 insertions(+), 26 deletions(-)


Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.111 
llvm/lib/Transforms/Scalar/ADCE.cpp:1.112
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.111   Sun Jun  3 01:26:14 2007
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Sun Jun  3 19:32:21 2007
@@ -387,8 +387,8 @@
   // postdominator that is alive, and the last postdominator that is
   // dead...
   //
-  PostDominatorTree::DomTreeNode *LastNode = DT[TI-getSuccessor(i)];
-  PostDominatorTree::DomTreeNode *NextNode = 0;
+  DomTreeNode *LastNode = DT[TI-getSuccessor(i)];
+  DomTreeNode *NextNode = 0;
 
   if (LastNode) {
 NextNode = LastNode-getIDom();


Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.58 
llvm/lib/Transforms/Scalar/GCSE.cpp:1.59
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.58Sun Jun  3 01:26:14 2007
+++ llvm/lib/Transforms/Scalar/GCSE.cpp Sun Jun  3 19:32:21 2007
@@ -94,7 +94,7 @@
 
   // Traverse the CFG of the function in dominator order, so that we see each
   // instruction after we see its operands.
-  for (df_iteratorDominatorTree::DomTreeNode* DI = 
df_begin(DT.getRootNode()),
+  for (df_iteratorDomTreeNode* DI = df_begin(DT.getRootNode()),
  E = df_end(DT.getRootNode()); DI != E; ++DI) {
 BasicBlock *BB = DI-getBlock();
 


Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.14 
llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.15
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.14  Sun Jun  3 17:02:14 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp   Sun Jun  3 19:32:21 2007
@@ -88,7 +88,7 @@
 // For a given block, calculate the generated expressions, temporaries,
 // and the AVAIL_OUT set
 void CalculateAvailOut(ValueTable VN, std::setValue*, ExprLT MS,
-   DominatorTree::DomTreeNode* DI,
+   DomTreeNode* DI,
std::setValue*, ExprLT currExps,
std::setPHINode* currPhis,
std::setValue* currTemps,
@@ -271,7 +271,7 @@
 }
 
 void GVNPRE::CalculateAvailOut(GVNPRE::ValueTable VN, std::setValue*, 
ExprLT MS,
-   DominatorTree::DomTreeNode* DI,
+   DomTreeNode* DI,
std::setValue*, ExprLT currExps,
std::setPHINode* currPhis,
std::setValue* currTemps,
@@ -333,7 +333,7 @@
   // First Phase of BuildSets - calculate AVAIL_OUT
   
   // Top-down walk of the dominator tree
-  for (df_iteratorDominatorTree::DomTreeNode* DI = 
df_begin(DT.getRootNode()),
+  for (df_iteratorDomTreeNode* DI = df_begin(DT.getRootNode()),
  E = df_end(DT.getRootNode()); DI != E; ++DI) {
 
 // Get the sets to update for this block
@@ -359,7 +359,7 @@
 std::setValue*, ExprLT anticOut;
 
 // Top-down walk of the postdominator tree
-for (df_iteratorPostDominatorTree::DomTreeNode* PDI = 
+for (df_iteratorDomTreeNode* PDI = 
  df_begin(PDT.getRootNode()), E = df_end(DT.getRootNode());
  PDI != E; ++PDI) {
   BasicBlock* BB = PDI-getBlock();


Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.103 
llvm/lib/Transforms/Scalar/LICM.cpp:1.104
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.103   Sun Jun  3 01:26:14 2007
+++ llvm/lib/Transforms/Scalar/LICM.cpp Sun Jun  3 19:32:21 2007
@@ -107,7 +107,7 @@
 /// visit uses before definitions, allowing us to sink a loop body in one
 /// pass without iteration.
 ///
-void SinkRegion(DominatorTree::DomTreeNode *N);
+void SinkRegion(DomTreeNode *N);
 
 /// HoistRegion - Walk the specified region of the CFG (defined by all
 /// blocks dominated by the specified block, and that are in the current
@@ -115,7 +115,7 @@
 /// visit definitions before uses, allowing us to hoist a loop body in one
 /// pass without iteration.
 ///
-void HoistRegion(DominatorTree::DomTreeNode *N);
+void HoistRegion(DomTreeNode *N);
 
 /// inSubLoop - Little predicate that returns true if the specified basic
 /// block is in a subloop of the current one, not the current one itself.
@@ -140,8 +140,8 @@
   if (BlockInLoop == LoopHeader)
 return true;
 
-  DominatorTree::DomTreeNode