Skip to content

Commit 68dee83

Browse files
author
Thomas Preud'homme
committed
[MachinePipeliner] Fix unscheduled instruction
Prior to ordering instructions to be scheduled, the machine pipeliner update recurrence node sets in groupRemainingNodes() by adding in a given node set any node on the dependency path from a node set with higher priority to the given node set. The function computePath() that determine what constitutes a path follows artificial dependencies. However, when ordering the nodes in the resulting node sets, computeNodeOrder() calls ignoreDependence when looking at dependencies which ignores artificial dependencies. This can cause a node not to be scheduled which then causes wrong code generation and in the case of a debug build will lead to an assert failure in generatePhis() in ModuloScheduler.cpp. This commit adds calls to ignoreDependence() in computePath() to not add any node in groupRemainingNodes() that would not be ordered by computeNodeOrder(). Reviewed By: sgundapa Differential Revision: https://reviews.llvm.org/D124267
1 parent 1f37d94 commit 68dee83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/MachinePipeliner.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,9 @@ static bool computePath(SUnit *Cur, SetVector<SUnit *> &Path,
15801580
return Path.contains(Cur);
15811581
bool FoundPath = false;
15821582
for (auto &SI : Cur->Succs)
1583-
FoundPath |= computePath(SI.getSUnit(), Path, DestNodes, Exclude, Visited);
1583+
if (!ignoreDependence(SI, false))
1584+
FoundPath |=
1585+
computePath(SI.getSUnit(), Path, DestNodes, Exclude, Visited);
15841586
for (auto &PI : Cur->Preds)
15851587
if (PI.getKind() == SDep::Anti)
15861588
FoundPath |=

0 commit comments

Comments
 (0)