[llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h CallGraph.h ConstantsScanner.h DSGraph.h DSGraphTraits.h DSNode.h DSSupport.h DataStructure.h DependenceGraph.h InstForest.h IntervalIterator.h MemoryDepAnalysis.h PgmDependenceGraph.h

John Criswell criswell at choi.cs.uiuc.edu
Thu Jun 26 16:44:03 PDT 2003


Changes in directory llvm/include/llvm/Analysis:

AliasSetTracker.h updated: 1.5.2.1 -> 1.5.2.2
CallGraph.h updated: 1.27.2.1 -> 1.27.2.2
ConstantsScanner.h updated: 1.10.2.1 -> 1.10.2.2
DSGraph.h updated: 1.48.2.1 -> 1.48.2.2
DSGraphTraits.h updated: 1.14.2.1 -> 1.14.2.2
DSNode.h updated: 1.24.2.1 -> 1.24.2.2
DSSupport.h updated: 1.16.2.1 -> 1.16.2.2
DataStructure.h updated: 1.63.2.1 -> 1.63.2.2
DependenceGraph.h updated: 1.4.2.1 -> 1.4.2.2
InstForest.h updated: 1.17.2.1 -> 1.17.2.2
IntervalIterator.h updated: 1.11.2.1 -> 1.11.2.2
MemoryDepAnalysis.h updated: 1.2.2.1 -> 1.2.2.2
PgmDependenceGraph.h updated: 1.2.2.1 -> 1.2.2.2

---
Log message:

Merged with mainline on Thursday, June 26, 2003.
Kept includes of "Config/assert.h" to avoid implicit dependencies on header
files.


---
Diffs of the changes:

Index: llvm/include/llvm/Analysis/AliasSetTracker.h
diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.5.2.1 llvm/include/llvm/Analysis/AliasSetTracker.h:1.5.2.2
--- llvm/include/llvm/Analysis/AliasSetTracker.h:1.5.2.1	Mon Jun 23 13:51:46 2003
+++ llvm/include/llvm/Analysis/AliasSetTracker.h	Thu Jun 26 16:34:42 2003
@@ -11,7 +11,6 @@
 #define LLVM_ANALYSIS_ALIASSETTRACKER_H
 
 #include "Config/assert.h"
-
 #include "llvm/Support/CallSite.h"
 #include "Support/iterator"
 #include "Support/hash_map"


Index: llvm/include/llvm/Analysis/CallGraph.h
diff -u llvm/include/llvm/Analysis/CallGraph.h:1.27.2.1 llvm/include/llvm/Analysis/CallGraph.h:1.27.2.2
--- llvm/include/llvm/Analysis/CallGraph.h:1.27.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/CallGraph.h	Thu Jun 26 16:34:42 2003
@@ -42,7 +42,6 @@
 #define LLVM_ANALYSIS_CALLGRAPH_H
 
 #include "Config/assert.h"
-
 #include "Support/GraphTraits.h"
 #include "Support/STLExtras.h"
 #include "llvm/Pass.h"


Index: llvm/include/llvm/Analysis/ConstantsScanner.h
diff -u llvm/include/llvm/Analysis/ConstantsScanner.h:1.10.2.1 llvm/include/llvm/Analysis/ConstantsScanner.h:1.10.2.2
--- llvm/include/llvm/Analysis/ConstantsScanner.h:1.10.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/ConstantsScanner.h	Thu Jun 26 16:34:42 2003
@@ -10,7 +10,6 @@
 #define LLVM_ANALYSIS_CONSTANTSSCANNER_H
 
 #include "Config/assert.h"
-
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Instruction.h"
 #include "Support/iterator"


Index: llvm/include/llvm/Analysis/DSGraph.h
diff -u llvm/include/llvm/Analysis/DSGraph.h:1.48.2.1 llvm/include/llvm/Analysis/DSGraph.h:1.48.2.2
--- llvm/include/llvm/Analysis/DSGraph.h:1.48.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/DSGraph.h	Thu Jun 26 16:34:42 2003
@@ -8,7 +8,6 @@
 #define LLVM_ANALYSIS_DSGRAPH_H
 
 #include "Config/assert.h"
-
 #include "llvm/Analysis/DSNode.h"
 
 //===----------------------------------------------------------------------===//
@@ -137,9 +136,9 @@
   /// maskNodeTypes - Apply a mask to all of the node types in the graph.  This
   /// is useful for clearing out markers like Incomplete.
   ///
-  void maskNodeTypes(unsigned char Mask) {
+  void maskNodeTypes(unsigned Mask) {
     for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
-      Nodes[i]->NodeType &= Mask;
+      Nodes[i]->maskNodeTypes(Mask);
   }
   void maskIncompleteMarkers() { maskNodeTypes(~DSNode::Incomplete); }
 


Index: llvm/include/llvm/Analysis/DSGraphTraits.h
diff -u llvm/include/llvm/Analysis/DSGraphTraits.h:1.14.2.1 llvm/include/llvm/Analysis/DSGraphTraits.h:1.14.2.2
--- llvm/include/llvm/Analysis/DSGraphTraits.h:1.14.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/DSGraphTraits.h	Thu Jun 26 16:34:42 2003
@@ -10,7 +10,6 @@
 #define LLVM_ANALYSIS_DSGRAPHTRAITS_H
 
 #include "Config/assert.h"
-
 #include "llvm/Analysis/DSGraph.h"
 #include "Support/GraphTraits.h"
 #include "Support/iterator"
@@ -28,7 +27,7 @@
   DSNodeIterator(NodeTy *N, bool) : Node(N) {         // Create end iterator
     Offset = N->getNumLinks() << DS::PointerShift;
     if (Offset == 0 && Node->getForwardNode() &&
-        (Node->NodeType & DSNode::DEAD))        // Model Forward link
+        Node->isDeadNode())        // Model Forward link
       Offset += DS::PointerSize;
   }
 public:
@@ -47,7 +46,7 @@
   }
   
   pointer operator*() const {
-    if (Node->NodeType & DSNode::DEAD)
+    if (Node->isDeadNode())
       return Node->getForwardNode();
     else
       return Node->getLink(Offset).getNode();


Index: llvm/include/llvm/Analysis/DSNode.h
diff -u llvm/include/llvm/Analysis/DSNode.h:1.24.2.1 llvm/include/llvm/Analysis/DSNode.h:1.24.2.2
--- llvm/include/llvm/Analysis/DSNode.h:1.24.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/DSNode.h	Thu Jun 26 16:34:42 2003
@@ -8,8 +8,8 @@
 #define LLVM_ANALYSIS_DSNODE_H
 
 #include "Config/assert.h"
-
 #include "llvm/Analysis/DSSupport.h"
+
 template<typename BaseType>
 class DSNodeIterator;          // Data structure graph traversal iterator
 
@@ -69,24 +69,27 @@
     GlobalNode  = 1 << 2,   // This node was allocated by a global var decl
     UnknownNode = 1 << 3,   // This node points to unknown allocated memory 
     Incomplete  = 1 << 4,   // This node may not be complete
+
     Modified    = 1 << 5,   // This node is modified in this context
     Read        = 1 << 6,   // This node is read in this context
+
     Array       = 1 << 7,   // This node is treated like an array
-#if 1
+    //#ifndef NDEBUG
     DEAD        = 1 << 8,   // This node is dead and should not be pointed to
-#endif
+    //#endif
 
     Composition = AllocaNode | HeapNode | GlobalNode | UnknownNode,
   };
   
   /// NodeType - A union of the above bits.  "Shadow" nodes do not add any flags
   /// to the nodes in the data structure graph, so it is possible to have nodes
-  /// with a value of 0 for their NodeType.  Scalar and Alloca markers go away
-  /// when function graphs are inlined.
+  /// with a value of 0 for their NodeType.
   ///
+private:
   unsigned short NodeType;
+public:
 
-  DSNode(unsigned NodeTy, const Type *T, DSGraph *G);
+  DSNode(const Type *T, DSGraph *G);
   DSNode(const DSNode &, DSGraph *G);
 
   ~DSNode() {
@@ -122,14 +125,6 @@
   /// return the number of nodes forwarding over the node!
   unsigned getNumReferrers() const { return NumReferrers; }
 
-  /// isModified - Return true if this node may be modified in this context
-  ///
-  bool isModified() const { return (NodeType & Modified) != 0; }
-
-  /// isRead - Return true if this node may be read in this context
-  ///
-  bool isRead() const { return (NodeType & Read) != 0; }
-
   DSGraph *getParentGraph() const { return ParentGraph; }
   void setParentGraph(DSGraph *G) { ParentGraph = G; }
 
@@ -234,7 +229,42 @@
   ///
   void addGlobal(GlobalValue *GV);
   const std::vector<GlobalValue*> &getGlobals() const { return Globals; }
-  std::vector<GlobalValue*> &getGlobals() { return Globals; }
+
+  /// maskNodeTypes - Apply a mask to the node types bitfield.
+  ///
+  void maskNodeTypes(unsigned Mask) {
+    NodeType &= Mask;
+  }
+
+  /// getNodeFlags - Return all of the flags set on the node.  If the DEAD flag
+  /// is set, hide it from the caller.
+  unsigned getNodeFlags() const { return NodeType & ~DEAD; }
+
+  bool isAllocaNode()  const { return NodeType & AllocaNode; }
+  bool isHeapNode()    const { return NodeType & HeapNode; }
+  bool isGlobalNode()  const { return NodeType & GlobalNode; }
+  bool isUnknownNode() const { return NodeType & UnknownNode; }
+
+  bool isModified() const   { return NodeType & Modified; }
+  bool isRead() const       { return NodeType & Read; }
+
+  bool isIncomplete() const { return NodeType & Incomplete; }
+  bool isDeadNode() const   { return NodeType & DEAD; }
+
+  DSNode *setAllocaNodeMarker()  { NodeType |= AllocaNode;  return this; }
+  DSNode *setHeapNodeMarker()    { NodeType |= HeapNode;    return this; }
+  DSNode *setGlobalNodeMarker()  { NodeType |= GlobalNode;  return this; }
+  DSNode *setUnknownNodeMarker() { NodeType |= UnknownNode; return this; }
+
+  DSNode *setIncompleteMarker() { NodeType |= Incomplete; return this; }
+  DSNode *setModifiedMarker()   { NodeType |= Modified;   return this; }
+  DSNode *setReadMarker()       { NodeType |= Read;       return this; }
+
+  void makeNodeDead() {
+    Globals.clear();
+    assert(hasNoReferrers() && "Dead node shouldn't have refs!");
+    NodeType = DEAD;
+  }
 
   /// forwardNode - Mark this node as being obsolete, and all references to it
   /// should be forwarded to the specified node and offset.
@@ -295,7 +325,6 @@
     }
   }
   assert(!N || ((N->NodeType & DSNode::DEAD) == 0));
-
   assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) ||
           !N->ForwardNH.isNull()) && "Node handle offset out of range!");
 }


Index: llvm/include/llvm/Analysis/DSSupport.h
diff -u llvm/include/llvm/Analysis/DSSupport.h:1.16.2.1 llvm/include/llvm/Analysis/DSSupport.h:1.16.2.2
--- llvm/include/llvm/Analysis/DSSupport.h:1.16.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/DSSupport.h	Thu Jun 26 16:34:42 2003
@@ -8,10 +8,10 @@
 #define LLVM_ANALYSIS_DSSUPPORT_H
 
 #include "Config/assert.h"
-
 #include <vector>
 #include <functional>
 #include <string>
+#include <assert.h>
 #include "Support/HashExtras.h"
 #include "Support/hash_set"
 


Index: llvm/include/llvm/Analysis/DataStructure.h
diff -u llvm/include/llvm/Analysis/DataStructure.h:1.63.2.1 llvm/include/llvm/Analysis/DataStructure.h:1.63.2.2
--- llvm/include/llvm/Analysis/DataStructure.h:1.63.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/DataStructure.h	Thu Jun 26 16:34:42 2003
@@ -8,7 +8,6 @@
 #define LLVM_ANALYSIS_DATA_STRUCTURE_H
 
 #include "Config/assert.h"
-
 #include "llvm/Pass.h"
 #include "Support/HashExtras.h"
 #include "Support/hash_set"


Index: llvm/include/llvm/Analysis/DependenceGraph.h
diff -u llvm/include/llvm/Analysis/DependenceGraph.h:1.4.2.1 llvm/include/llvm/Analysis/DependenceGraph.h:1.4.2.2
--- llvm/include/llvm/Analysis/DependenceGraph.h:1.4.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/DependenceGraph.h	Thu Jun 26 16:34:42 2003
@@ -14,7 +14,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-
 #ifndef LLVM_ANALYSIS_DEPENDENCEGRAPH_H
 #define LLVM_ANALYSIS_DEPENDENCEGRAPH_H
 


Index: llvm/include/llvm/Analysis/InstForest.h
diff -u llvm/include/llvm/Analysis/InstForest.h:1.17.2.1 llvm/include/llvm/Analysis/InstForest.h:1.17.2.2
--- llvm/include/llvm/Analysis/InstForest.h:1.17.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/InstForest.h	Thu Jun 26 16:34:42 2003
@@ -14,8 +14,6 @@
 #ifndef LLVM_ANALYSIS_INSTFOREST_H
 #define LLVM_ANALYSIS_INSTFOREST_H
 
-#include "llvm/Instruction.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/Function.h"
 #include "Support/Tree.h"
 #include <map>


Index: llvm/include/llvm/Analysis/IntervalIterator.h
diff -u llvm/include/llvm/Analysis/IntervalIterator.h:1.11.2.1 llvm/include/llvm/Analysis/IntervalIterator.h:1.11.2.2
--- llvm/include/llvm/Analysis/IntervalIterator.h:1.11.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/IntervalIterator.h	Thu Jun 26 16:34:42 2003
@@ -28,7 +28,6 @@
 
 #include "llvm/Analysis/IntervalPartition.h"
 #include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/Support/CFG.h"
 #include <stack>
 #include <set>


Index: llvm/include/llvm/Analysis/MemoryDepAnalysis.h
diff -u llvm/include/llvm/Analysis/MemoryDepAnalysis.h:1.2.2.1 llvm/include/llvm/Analysis/MemoryDepAnalysis.h:1.2.2.2
--- llvm/include/llvm/Analysis/MemoryDepAnalysis.h:1.2.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/MemoryDepAnalysis.h	Thu Jun 26 16:34:42 2003
@@ -7,6 +7,7 @@
 //
 // The result of this pass is a DependenceGraph for each function
 // representing the memory-based data dependences between instructions.
+//
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_ANALYSIS_MEMORYDEPANALYSIS_H
@@ -17,16 +18,11 @@
 #include "llvm/Analysis/DataStructure.h"
 #include "llvm/Pass.h"
 #include "Support/TarjanSCCIterator.h"
-#include "Support/NonCopyable.h"
 #include "Support/hash_map"
-
 #include "Config/assert.h"
 
 class Instruction;
-class Function;
-class DSGraph;
 class ModRefTable;
-
 
 ///---------------------------------------------------------------------------
 /// class MemoryDepGraph:


Index: llvm/include/llvm/Analysis/PgmDependenceGraph.h
diff -u llvm/include/llvm/Analysis/PgmDependenceGraph.h:1.2.2.1 llvm/include/llvm/Analysis/PgmDependenceGraph.h:1.2.2.2
--- llvm/include/llvm/Analysis/PgmDependenceGraph.h:1.2.2.1	Mon Jun 23 13:51:47 2003
+++ llvm/include/llvm/Analysis/PgmDependenceGraph.h	Thu Jun 26 16:34:42 2003
@@ -26,6 +26,7 @@
 //
 // class PgmDependenceGraph -- Interface to obtain PDGIterators for each
 //                          instruction.
+//
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_ANALYSIS_PGMDEPENDENCEGRAPH_H
@@ -35,15 +36,10 @@
 #include "llvm/Analysis/MemoryDepAnalysis.h"
 /* #include "llvm/Analysis/PostDominators.h" -- see below */
 #include "llvm/Instruction.h"
-#include "llvm/Value.h"
 #include "llvm/Pass.h"
-#include "Support/NonCopyable.h"
 #include <iterator>
 
 #include "Config/assert.h"
-
-class Instruction;
-class Function;
 class DSGraph;
 class DependenceGraph;
 class PgmDependenceGraph;





More information about the llvm-commits mailing list