[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 05:27:29 PST 2024


================
@@ -346,12 +347,15 @@ getScalableECFromSignature(const FunctionType *Signature, const VFISAKind ISA,
   // Also check the return type if not void.
   Type *RetTy = Signature->getReturnType();
   if (!RetTy->isVoidTy()) {
-    std::optional<ElementCount> ReturnEC = getElementCountForTy(ISA, RetTy);
-    // If we have an unknown scalar element type we can't find a reasonable VF.
-    if (!ReturnEC)
-      return std::nullopt;
-    if (ElementCount::isKnownLT(*ReturnEC, MinEC))
-      MinEC = *ReturnEC;
+    for (Type *RetTy : getContainedTypes(RetTy)) {
----------------
david-arm wrote:

Given that this patch only intends to support vectorising calls to homogenous, packed, literal structs (see canWidenType) is it worth restricting it to the same here? It would narrow the scope of the changes and means that when calling `ToWideTy` in `createFunctionType` we only have to worry about homogenous structs too.

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


More information about the llvm-commits mailing list