Don't call setDepthDirty/setHeightDirty when adding an edge
authorDan Gohman <gohman@apple.com>
Mon, 5 Jan 2009 22:40:26 +0000 (22:40 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 5 Jan 2009 22:40:26 +0000 (22:40 +0000)
with latency 0, since it doesn't affect the depth or height.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61762 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAG.cpp

index c2d291dadd3ef002dd6d8071e299a2fbd4229ea2..730080d0fa4e36e49f9c476853d148686795aee3 100644 (file)
@@ -77,8 +77,10 @@ void SUnit::addPred(const SDep &D) {
     ++N->NumSuccsLeft;
   N->Succs.push_back(P);
   Preds.push_back(D);
-  this->setDepthDirty();
-  N->setHeightDirty();
+  if (P.getLatency() != 0) {
+    this->setDepthDirty();
+    N->setHeightDirty();
+  }
 }
 
 /// removePred - This removes the specified edge as a pred of the current
@@ -112,8 +114,10 @@ void SUnit::removePred(const SDep &D) {
         --NumPredsLeft;
       if (!isScheduled)
         --N->NumSuccsLeft;
-      this->setDepthDirty();
-      N->setHeightDirty();
+      if (P.getLatency() != 0) {
+        this->setDepthDirty();
+        N->setHeightDirty();
+      }
       return;
     }
 }