There is no need to clone over nodes that are going to be dead anyway
authorChris Lattner <sabre@nondot.org>
Sat, 7 Feb 2004 22:00:03 +0000 (22:00 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 7 Feb 2004 22:00:03 +0000 (22:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11157 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index 470899e07024a9c3c7a823e5582e71c3ff92a69b..5050515bc288bafe41070c5fb5942f3a151f73ab 100644 (file)
@@ -1112,9 +1112,11 @@ void DSGraph::cloneInto(const DSGraph &G, DSScalarMap &OldValMap,
   BitsToClear |= DSNode::DEAD;  // Clear dead flag...
   for (unsigned i = 0, e = G.Nodes.size(); i != e; ++i) {
     DSNode *Old = G.Nodes[i];
-    DSNode *New = new DSNode(*Old, this);
-    New->maskNodeTypes(~BitsToClear);
-    OldNodeMap[Old] = New;
+    if (!Old->isForwarding()) {
+      DSNode *New = new DSNode(*Old, this);
+      New->maskNodeTypes(~BitsToClear);
+      OldNodeMap[Old] = New;
+    }
   }
 #ifndef NDEBUG
   Timer::addPeakMemoryMeasurement();