llvm::VFABI::tryDemangleForVFABI

Function to construct a VFInfo out of a mangled names in the following format:

Synopsis

Declared in <llvm/IR/VFABIDemangler.h>

std::optional<VFInfo>
tryDemangleForVFABI(
    StringRef MangledName,
    FunctionType const* FTy);

Description

<VFABI_name>{(<redirection>)}

where <VFABI_name> is the name of the vector function, mangled according to the rules described in the Vector Function ABI of the target vector extension (or <isa> from now on). The <VFABI_name> is in the following format:

ZGV<isa><mask><vlen><parameters><scalarname>[(<redirection>)]

This methods support demangling rules for the following <isa>:

* AArch64: https://developer.arm.com/docs/101129/latest

* x86 (libmvec): https://sourceware.org/glibc/wiki/libmvec and https://sourceware.org/glibc/wiki/libmvec?action=AttachFile&do=view&target=VectorABI.txt

Return Value

The demangled VFInfo on success, or std::nullopt on failure.

Parameters

NameDescription
MangledName-> input string in the format ZGV<isa><mask><vlen><parameters><scalarname>[(<redirection>)].
FTy-> FunctionType of the scalar function which we're trying to find a vectorized variant for. This is required to determine the vectorization factor for scalable vectors, since the mangled name doesn't encode that; it needs to be derived from the widest element types of vector arguments or return values.