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

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 3 11:14:04 PST 2003


Changes in directory llvm/lib/Analysis/DataStructure:

DataStructure.cpp updated: 1.96 -> 1.97
Local.cpp updated: 1.51 -> 1.52

---
Log message:

Don't apply type information to load instructions if it will cause collapsing


---
Diffs of the changes:

Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.96 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.97
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.96	Fri Feb 14 17:27:18 2003
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp	Mon Mar  3 11:13:31 2003
@@ -152,7 +152,8 @@
 ///
 /// This method returns true if the node is completely folded, otherwise false.
 ///
-bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset) {
+bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
+                           bool FoldIfIncompatible) {
   // Check to make sure the Size member is up-to-date.  Size can be one of the
   // following:
   //  Size = 0, Ty = Void: Nothing is known about this node.
@@ -213,14 +214,14 @@
     // It is illegal to grow this node if we have treated it as an array of
     // objects...
     if (isArray()) {
-      foldNodeCompletely();
+      if (FoldIfIncompatible) foldNodeCompletely();
       return true;
     }
 
     if (Offset) {  // We could handle this case, but we don't for now...
       DEBUG(std::cerr << "UNIMP: Trying to merge a growth type into "
                       << "offset != 0: Collapsing!\n");
-      foldNodeCompletely();
+      if (FoldIfIncompatible) foldNodeCompletely();
       return true;
     }
 
@@ -277,7 +278,7 @@
       break;
     }
     default:
-      foldNodeCompletely();
+      if (FoldIfIncompatible) foldNodeCompletely();
       return true;
     }
   }
@@ -356,7 +357,7 @@
                   << "\n due to:" << NewTy << " @ " << Offset << "!\n"
                   << "SubType: " << SubType << "\n\n");
 
-  foldNodeCompletely();
+  if (FoldIfIncompatible) foldNodeCompletely();
   return true;
 }
 


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.51 llvm/lib/Analysis/DataStructure/Local.cpp:1.52
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.51	Thu Feb 13 22:55:58 2003
+++ llvm/lib/Analysis/DataStructure/Local.cpp	Mon Mar  3 11:13:31 2003
@@ -368,7 +368,7 @@
   Ptr.getNode()->NodeType |= DSNode::Read;
 
   // Ensure a typerecord exists...
-  Ptr.getNode()->mergeTypeInfo(LI.getType(), Ptr.getOffset());
+  Ptr.getNode()->mergeTypeInfo(LI.getType(), Ptr.getOffset(), false);
 
   if (isPointerType(LI.getType()))
     setDestTo(LI, getLink(Ptr));





More information about the llvm-commits mailing list