[llvm] [SLP][NFC]Extract values state/operands analysis into separate class (PR #138724)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 09:26:54 PDT 2025


================
@@ -2896,11 +2885,17 @@ class BoUpSLP {
         // Since operand reordering is performed on groups of commutative
         // operations or alternating sequences (e.g., +, -), we can safely tell
         // the inverse operations by checking commutativity.
-        auto [SelectedOp, Ops] = convertTo(cast<Instruction>(VL[Lane]), S);
+        auto *I = dyn_cast<Instruction>(VL[Lane]);
+        if (!I && isa<PoisonValue>(VL[Lane])) {
----------------
alexey-bataev wrote:

Why? The logic I introduced here does not brake any assumptions. Added the assertion, that the instruction is expected.

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


More information about the llvm-commits mailing list