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

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 13 13:10:04 PST 2003


Changes in directory llvm/lib/Analysis/DataStructure:

DataStructure.cpp updated: 1.93 -> 1.94

---
Log message:

Move node forwarding code from being inlined to being out-of-line.

This brings a 11.6% speedup to steens, and a 3.6 overall speedup to ds-aa



---
Diffs of the changes:

Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.93 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.94
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.93	Tue Feb 11 17:11:43 2003
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp	Thu Feb 13 13:09:00 2003
@@ -24,6 +24,27 @@
 }
 using namespace DS;
 
+DSNode *DSNodeHandle::HandleForwarding() const {
+  assert(!N->ForwardNH.isNull() && "Can only be invoked if forwarding!");
+
+  // Handle node forwarding here!
+  DSNode *Next = N->ForwardNH.getNode();  // Cause recursive shrinkage
+  Offset += N->ForwardNH.getOffset();
+
+  if (--N->NumReferrers == 0) {
+    // Removing the last referrer to the node, sever the forwarding link
+    N->stopForwarding();
+  }
+
+  N = Next;
+  N->NumReferrers++;
+  if (N->Size <= Offset) {
+    assert(N->Size <= 1 && "Forwarded to shrunk but not collapsed node?");
+    Offset = 0;
+  }
+  return N;
+}
+
 //===----------------------------------------------------------------------===//
 // DSNode Implementation
 //===----------------------------------------------------------------------===//





More information about the llvm-commits mailing list