[llvm] [SLP]Enable float point math ops as copyables elements. (PR #169857)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 3 09:55:22 PST 2025
================
@@ -5363,28 +5364,28 @@ class slpvectorizer::BoUpSLP {
// reordered.
// Same applies even for non-commutative cmps, because we can invert
// their predicate potentially and, thus, reorder the operands.
+ constexpr unsigned NumCommutativeOps = 2;
bool IsCommutativeUser =
- ::isCommutative(User) ||
- ::isCommutative(TE->getMatchingMainOpOrAltOp(User), User);
- if (!IsCommutativeUser && !isa<CmpInst>(User)) {
- unsigned &OpCnt =
- OrderedEntriesCount.try_emplace(TE, 0).first->getSecond();
+ U.getOperandNo() < NumCommutativeOps &&
----------------
alexey-bataev wrote:
Yes. For example, fmuladd is commutative, but only first 2 operands are commutative, the third is not
https://github.com/llvm/llvm-project/pull/169857
More information about the llvm-commits
mailing list