[llvm] [TLI] Use the VFABI demangling when declaring vector variants. (PR #76753)

Alexandros Lamprineas via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 03:22:15 PST 2024


================
@@ -37,20 +37,39 @@ STATISTIC(NumCompUsedAdded,
 /// vectorizes the CallInst CI with a vectorization factor of VF
 /// lanes. The TLI assumes that all parameters and the return type of
 /// CI (other than void) need to be widened to a VectorType of VF
-/// lanes.
+/// lanes unless the VFABI says otherwise.
 static void addVariantDeclaration(CallInst &CI, const ElementCount &VF,
-                                  bool Predicate, const StringRef VFName) {
+                                  const VecDesc *VD) {
   Module *M = CI.getModule();
 
   // Add function declaration.
   Type *RetTy = ToVectorTy(CI.getType(), VF);
   SmallVector<Type *, 4> Tys;
-  for (Value *ArgOperand : CI.args())
-    Tys.push_back(ToVectorTy(ArgOperand->getType(), VF));
+
+  const std::optional<VFInfo> Info = VFABI::tryDemangleForVFABI(
+      VD->getVectorFunctionABIVariantString(), CI.getFunctionType());
+
+  assert(Info && Info->Shape.VF == VF && "Mangled name does not match VF");
----------------
labrinea wrote:

Done

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


More information about the llvm-commits mailing list