[llvm] [VFABI] Create FunctionType for vector functions (PR #75058)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 05:53:20 PST 2023


================
@@ -1477,6 +1480,32 @@ void VFABI::getVectorVariantNames(
   }
 }
 
+FunctionType *VFABI::createFunctionType(const VFInfo &Info,
+                                        const FunctionType *ScalarFTy) {
+  ElementCount VF = Info.Shape.VF;
+  // Create vector parameter types
+  SmallVector<Type *, 8> VecTypes;
+  for (auto [STy, VFParam] : zip(ScalarFTy->params(), Info.Shape.Parameters)) {
+    if (VFParam.ParamKind == VFParamKind::Vector)
+      VecTypes.push_back(VectorType::get(STy, VF));
+    else
+      VecTypes.push_back(STy);
+  }
+
+  // Get mask's position mask and append one if not present in the Instruction.
+  if (auto OptMaskPos = Info.getParamIndexForOptionalMask()) {
+    if (!OptMaskPos)
+      return nullptr;
----------------
paulwalker-arm wrote:

This code is unreachable and can be removed.

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


More information about the llvm-commits mailing list