[llvm] [SLP] NFC. Replace TreeEntry::setOperandsInOrder with VLOperands. (PR #113880)

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 10:14:19 PDT 2024


================
@@ -1948,6 +1948,9 @@ class BoUpSLP {
 
     /// A vector of operand vectors.
     SmallVector<OperandDataVec, 4> OpsVec;
+    /// When VL[0] is IntrinsicInst, Arg_size is CallBase::arg_size. When VL[0]
+    /// is not IntrinsicInst, Arg_size is User::getNumOperands.
+    unsigned Arg_size;
----------------
HanKuanChen wrote:

For `IntrinsicInst` with more than 2 operands, `VLOperands::appendOperandsOfVL` stores the first two operands but `TreeEntry::setOperandsInOrder` stores all of the operands.
Only the first two operands should be reorder. But all of the operands can be passed into `buildTree_rec`.
If we don't use a new data member (`Arg_size`), either reorder swap non-swappable operands or we need to keep `TreeEntry::setOperandsInOrder`.

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


More information about the llvm-commits mailing list