diff options
author | Thomas Preud'homme <thomasp@graphcore.ai> | 2022-04-05 22:34:40 +0100 |
---|---|---|
committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2022-05-05 16:01:41 +0100 |
commit | 68dee83923c4cfa09a8cf81399a7bc77ca6bd811 (patch) | |
tree | 3d64e44e298c5736c757b74268b61e460e39e982 /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | 1f37d948383a7ef009d4cfe35a0ce7fe4d21c8a0 (diff) | |
download | llvm-68dee83923c4cfa09a8cf81399a7bc77ca6bd811.zip llvm-68dee83923c4cfa09a8cf81399a7bc77ca6bd811.tar.gz llvm-68dee83923c4cfa09a8cf81399a7bc77ca6bd811.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachinePipeliner.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index 9ea6e9b..15d1621 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -1580,7 +1580,9 @@ static bool computePath(SUnit *Cur, SetVector<SUnit *> &Path, return Path.contains(Cur); bool FoundPath = false; for (auto &SI : Cur->Succs) - FoundPath |= computePath(SI.getSUnit(), Path, DestNodes, Exclude, Visited); + if (!ignoreDependence(SI, false)) + FoundPath |= + computePath(SI.getSUnit(), Path, DestNodes, Exclude, Visited); for (auto &PI : Cur->Preds) if (PI.getKind() == SDep::Anti) FoundPath |= |