[llvm] [SLP][NFC] Redesign schedule bundle, separate from schedule data, NFC (PR #131625)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 19 07:45:57 PDT 2025


================
@@ -3781,22 +3782,23 @@ class BoUpSLP {
         }
       }
       // Update the scheduler bundle to point to this TreeEntry.
-      ScheduleData *BundleMember = *Bundle;
-      assert((BundleMember || isa<PHINode>(S.getMainOp()) ||
+      assert((!Bundle.getBundle().empty() || isa<PHINode>(S.getMainOp()) ||
               isVectorLikeInstWithConstOps(S.getMainOp()) ||
               doesNotNeedToSchedule(VL)) &&
              "Bundle and VL out of sync");
-      if (BundleMember) {
+      if (!Bundle.getBundle().empty()) {
+        auto *BundleMember = Bundle.getBundle().begin();
         for (Value *V : VL) {
           if (doesNotNeedToBeScheduled(V))
             continue;
-          if (!BundleMember)
+          if (BundleMember == Bundle.getBundle().end())
             continue;
-          BundleMember->TE = Last;
-          BundleMember = BundleMember->NextInBundle;
+          ++BundleMember;
         }
+        assert(BundleMember == Bundle.getBundle().end() &&
+               "Bundle and VL out of sync");
----------------
gbossu wrote:

Checking: I guess we cannot assert something like `Bundle.getBundle().size() == VL.size()` because some values do not need to be scheduled?

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


More information about the llvm-commits mailing list