[PATCH] D129161: [MachinePipeliner] Consider only direct path successors when calculating circuit latency

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 00:03:23 PDT 2022


barannikov88 accepted this revision.
barannikov88 added a comment.
This revision is now accepted and ready to land.

LGTM
Thank you for the detailed explanations here and on discourse, it made the issue clear and the review much easier.
The solution seems right, though it might be fragile as it relies on a particular implementation of circuits-finding algorithm.
One way to make it more reliable is to move the latency calculation into a private method SwingSchedulerDAG::Circuits, leaving the constructor of NodeSet trivial.



================
Comment at: llvm/include/llvm/CodeGen/MachinePipeliner.h:351
+      // the first node
+      SUnit *NextSUnit = ((i + 1) == e) ? Nodes[0] : Nodes[i + 1];
+
----------------
is a bit shorter and follows the general "modulo" idea :)
Not a strong preference, of course.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129161/new/

https://reviews.llvm.org/D129161



More information about the llvm-commits mailing list