[llvm] [SLP]Enable float point math ops as copyables elements. (PR #169857)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 8 07:00:50 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 &&
----------------
RKSimon wrote:
is there anyway that we can pull this out into a helper, ideally someplace in general code - I wouldn't be surprised if other passes like VectorCombine will need this at some point.
https://github.com/llvm/llvm-project/pull/169857
More information about the llvm-commits
mailing list