[llvm] [SLP] NFC. Replace TreeEntry::setOperandsInOrder with VLOperands. (PR #113880)
Han-Kuan Chen via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 29 21:13:34 PDT 2024
================
@@ -2366,7 +2363,10 @@ class BoUpSLP {
}
/// \returns the number of operands.
- unsigned getNumOperands() const { return OpsVec.size(); }
+ /// reorder can only work on instructions with 2 operands. If we use
+ /// OpsVec.size() here, reorder will swap non-swappable operands (because
+ /// APO is a boolean value).
+ unsigned getNumOperands() const { return 2; }
----------------
HanKuanChen wrote:
Then we still need arg_size here.
On the other hand, I am curious about how reorder support more operands. Only the first two operands of BinaryOperator, CmpInst and IntrinsicInst are commutative. What kinds of instructions can be supported if we enhance reorder?
https://github.com/llvm/llvm-project/pull/113880
More information about the llvm-commits
mailing list