[llvm] [SLP]Initial compatibility support for shl v, 1 and add v, v (PR #181168)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 09:04:01 PST 2026


================
@@ -23159,9 +23289,17 @@ void BoUpSLP::BlockScheduling::calculateDependencies(
         if (areAllOperandsReplacedByCopyableData(
                 cast<Instruction>(U), BundleMember->getInst(), *SLP, NumOps))
           continue;
-        BundleMember->incDependencies();
+        unsigned Inc = 1;
+        // Increment twice, since the operand was expanded in binop.
+        for (const TreeEntry *UserTE : SLP->getTreeEntries(U)) {
+          if (UserTE->isExpandedBinOp(U))
+            ++Inc;
+        }
+        if (ExpandedOps.contains(U))
+          ++Inc;
----------------
alexey-bataev wrote:

`%e1` is unused, so just ignored. `%1` is generated from gathered loads (unused in this case), which is not trimmed (during tree throttling) because of the `-slp-threshold=-5000`

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


More information about the llvm-commits mailing list