[llvm] [SLP]Pass operand info and context to TTI cost queries (PR #224931)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 20 14:26:32 PDT 2026


================
@@ -10322,9 +10325,21 @@ bool BoUpSLP::canBuildSplitNode(ArrayRef<Value *> VL,
       (LocalState.getMainOp()->isCast() && LocalState.getAltOp()->isCast()) ||
       (LocalState.getMainOp()->isUnaryOp() &&
        LocalState.getAltOp()->isUnaryOp())) {
+    SmallVector<Value *> Ops0, Ops1;
+    for (Value *V : VL) {
+      auto *I = dyn_cast<Instruction>(V);
+      if (!I)
+        continue;
+      Ops0.push_back(I->getOperand(0));
+      Ops1.push_back(I->getOperand(I->isBinaryOp() ? 1 : 0));
+    }
+    TTI::OperandValueInfo Op1Info = getOperandInfo(Ops0);
+    TTI::OperandValueInfo Op2Info = getOperandInfo(Ops1);
----------------
alexey-bataev wrote:

Fixed

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


More information about the llvm-commits mailing list