[llvm] [VFABI] Create FunctionType for vector functions (PR #75058)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 13 10:16:36 PST 2023
================
@@ -1477,6 +1480,37 @@ void VFABI::getVectorVariantNames(
}
}
+std::optional<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.
+ int MaskPos = -1;
+ if (Info.isMasked()) {
+ auto OptMaskPos = Info.getParamIndexForOptionalMask();
----------------
paulwalker-arm wrote:
What about `if (auto OptMaskPos = Info.getParamIndexForOptionalMask())`?
https://github.com/llvm/llvm-project/pull/75058
More information about the llvm-commits
mailing list