[llvm] [MachinePipeliner] Add validation for missed dependencies (PR #135148)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 05:25:10 PDT 2025


================
@@ -474,23 +562,6 @@ class NodeSet {
           DV = DU + Succ.getLatency();
       }
     }
-    // Handle a back-edge in loop carried dependencies
-    SUnit *FirstNode = Nodes[0];
-    SUnit *LastNode = Nodes[Nodes.size() - 1];
-
-    for (auto &PI : DDG->getInEdges(LastNode)) {
-      // If we have an order dep that is potentially loop carried then a
-      // back-edge exists between the last node and the first node that isn't
-      // modeled in the DAG. Handle it manually by adding 1 to the distance of
-      // the last node.
-      if (PI.getSrc() != FirstNode || !PI.isOrderDep() ||
-          !DAG->isLoopCarriedDep(PI))
-        continue;
-      unsigned &First = SUnitToDistance[FirstNode];
-      unsigned Last = SUnitToDistance[LastNode];
-      First = std::max(First, Last + 1);
-    }
----------------
kasuga-fj wrote:

This is no longer necessary because loop-carried dependencies are explicitly represented here.

https://github.com/llvm/llvm-project/pull/135148


More information about the llvm-commits mailing list