[llvm] [SLP]Unify getNumberOfParts use (PR #124774)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 08:13:44 PST 2025


================
@@ -9847,12 +9858,15 @@ void BoUpSLP::transformNodes() {
           // only with the single non-undef element).
           bool IsSplat = isSplat(Slice);
           if (Slices.empty() || !IsSplat ||
-              (VF <= 2 && 2 * std::clamp(TTI->getNumberOfParts(getWidenedType(
-                                             Slice.front()->getType(), VF)),
-                                         1U, VF - 1) !=
-                              std::clamp(TTI->getNumberOfParts(getWidenedType(
-                                             Slice.front()->getType(), 2 * VF)),
-                                         1U, 2 * VF)) ||
+              (VF <= 2 &&
+               2 * std::clamp(
+                       ::getNumberOfParts(
+                           *TTI, getWidenedType(Slice.front()->getType(), VF)),
+                       1U, VF - 1) !=
+                   std::clamp(::getNumberOfParts(
+                                  *TTI, getWidenedType(Slice.front()->getType(),
+                                                       2 * VF)),
+                              1U, 2 * VF)) ||
----------------
RKSimon wrote:

This is pretty horrible to read - any chance it can be cleaned up?

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


More information about the llvm-commits mailing list