[llvm] [SLP]Initial support for non-power-of-2 (but still whole register) number of elements in operands. (PR #106449)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 13:57:21 PDT 2024


================
@@ -1224,6 +1238,22 @@ static bool doesNotNeedToSchedule(ArrayRef<Value *> VL) {
          (all_of(VL, isUsedOutsideBlock) || all_of(VL, areAllOperandsNonInsts));
 }
 
+/// Returns true if widened type of \p Ty elements with size \p Sz represents
+/// full vector type, i.e. adding extra element results in extra parts upon type
+/// legalization.
+static bool hasFullVectorsOnly(const TargetTransformInfo &TTI, Type *Ty,
+                               unsigned Sz) {
+  if (Sz <= 1)
+    return false;
+  if (!isValidElementType(Ty) && !isa<FixedVectorType>(Ty))
----------------
RKSimon wrote:

I'm not certain but should this be: `!isValidElementType(Ty) || !isa<FixedVectorType>(Ty)`?

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


More information about the llvm-commits mailing list