Skip to content

Commit 52d4d82

Browse files
author
Dan Gohman
committed
Don't call setDepthDirty/setHeightDirty when adding an edge
with latency 0, since it doesn't affect the depth or height. llvm-svn: 61762
1 parent ced6524 commit 52d4d82

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

llvm/lib/CodeGen/ScheduleDAG.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ void SUnit::addPred(const SDep &D) {
7777
++N->NumSuccsLeft;
7878
N->Succs.push_back(P);
7979
Preds.push_back(D);
80-
this->setDepthDirty();
81-
N->setHeightDirty();
80+
if (P.getLatency() != 0) {
81+
this->setDepthDirty();
82+
N->setHeightDirty();
83+
}
8284
}
8385

8486
/// removePred - This removes the specified edge as a pred of the current
@@ -112,8 +114,10 @@ void SUnit::removePred(const SDep &D) {
112114
--NumPredsLeft;
113115
if (!isScheduled)
114116
--N->NumSuccsLeft;
115-
this->setDepthDirty();
116-
N->setHeightDirty();
117+
if (P.getLatency() != 0) {
118+
this->setDepthDirty();
119+
N->setHeightDirty();
120+
}
117121
return;
118122
}
119123
}

0 commit comments

Comments
 (0)