[llvm] [AMDGPU] IGroupLP: Avoid DAG manipulation in greedyFind (PR #194827)

Frederik Harwath via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 03:46:52 PDT 2026


================
@@ -322,6 +322,49 @@ class PipelineSolver {
   // return the number of edges missed.
   int addEdges(SmallVectorImpl<SchedGroup> &SyncPipeline, SUnit *SU, int SGID,
                std::list<std::pair<SUnit *, SUnit *>> &AddedEdges);
+
+  /// This class is used to build the edge set implied by an
+  /// assignment of an SUnit to a SchedGroup and to compute the cost
+  /// (edges that cannot be assigned without introducing cycles) of
+  /// the assignment.
+  class EdgeSetBuilder {
+    SUnit *SU;
+    SmallVectorImpl<SchedGroup> &SyncPipeline;
+    bool IsBottomUp;
+    DenseSet<SUnit *> InitialPreds;
----------------
frederik-h wrote:

I did some measurements and the average size of the InitialPreds set in the composable_kernel IR that I used is 20, standard deviation around 20, max over 400. More importantly, the compile times did not improve and even went up on some examples when I tried to use SmallSet with size 8, 16, or 32. I would rather not change it.

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


More information about the llvm-commits mailing list