[llvm] Refactor try demangle for vfabi to use only the vector abi mangled names (PR #67430)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 03:19:54 PDT 2023


================
@@ -434,22 +434,33 @@ std::optional<VFInfo> VFABI::tryDemangleForVFABI(StringRef MangledName,
   // need to make sure that the VF field of the VFShape class is never
   // set to 0.
   if (IsScalable) {
-    const Function *F = M.getFunction(VectorName);
-    // The declaration of the function must be present in the module
-    // to be able to retrieve its signature.
-    if (!F)
+    if (ISA != VFISAKind::SVE)
       return std::nullopt;
-    const ElementCount EC = getECFromSignature(F->getFunctionType());
----------------
JolantaJensen wrote:

But to get the FunctionType, I need the Function itself, and to get the Function I need the Module. And what about an Instruction that isn't a CallInstruction and won't give me a Function? Or do you mean passing FunctionType instead of the vector with Operand Types? Or passing the Instruction itself as argument?

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


More information about the llvm-commits mailing list