[llvm] [SLP] NFC. Make InstructionsState more constant. (PR #118609)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 15:49:44 PST 2024


================
@@ -8133,13 +8145,14 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
   // a load), in which case peek through to include it in the tree, without
   // ballooning over-budget.
   if (Depth >= RecursionMaxDepth &&
-      !(S.MainOp && isa<Instruction>(S.MainOp) && S.MainOp == S.AltOp &&
+      !(S.getMainOp() && isa<Instruction>(S.getMainOp()) && !S.isAltShuffle() &&
         VL.size() >= 4 &&
-        (match(S.MainOp, m_Load(m_Value())) || all_of(VL, [&S](const Value *I) {
+        (match(S.getMainOp(), m_Load(m_Value())) ||
+         all_of(VL, [&S](const Value *I) {
            return match(I,
                         m_OneUse(m_ZExtOrSExt(m_OneUse(m_Load(m_Value()))))) &&
                   cast<Instruction>(I)->getOpcode() ==
-                      cast<Instruction>(S.MainOp)->getOpcode();
+                      cast<Instruction>(S.getMainOp())->getOpcode();
----------------
alexey-bataev wrote:

```suggestion
                     S.getMainOp()->getOpcode();
```


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


More information about the llvm-commits mailing list