diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-13 19:09:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-13 19:09:00 +0000 |
commit | a17866894a766bdb700581990237b1043694e3ae (patch) | |
tree | ceca081f902f638bc7da1698e505016eb1b6dc01 /llvm/lib/Analysis/DataStructure/DataStructure.cpp | |
parent | 4bb0806f91a0ea9071ff9eadf1c4dde393af9bb0 (diff) | |
download | bcm5719-llvm-a17866894a766bdb700581990237b1043694e3ae.tar.gz bcm5719-llvm-a17866894a766bdb700581990237b1043694e3ae.zip |
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
llvm-svn: 5552
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/DataStructure.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp index 80586de2f14..f2817623d22 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp @@ -24,6 +24,27 @@ namespace DS { // TODO: FIXME } 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 //===----------------------------------------------------------------------===// |