[llvm] Fix mechanism propagating mangled names for TLI function mappings (PR #66656)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 03:48:13 PDT 2023


mikaelholmen wrote:

Hi @JolantaJensen and others,

I'm seeing problems with this patch for my out-of-tree target.

For this targert we have a bunch of target intrinsics that we say are vectorizable, but we don't provide a name of the vector version of the intrinsic. This means that before this patch, addMappingsFromTLI wouldn't do much since TLI.getVectorizedFunction(ScalarName, VF, Predicate) returned "" and AddVariantDecl wouldn't add anything.

Vectorization then worked as we wanted anyway.

With this patch, the vectorFn name guard in AddVariantDecl has apparently been removed and instead
something is indeed added to Mappings. And then setVectorVariantNames fails with
`
opt: ../lib/Transforms/Utils/ModuleUtils.cpp:352: void llvm::VFABI::setVectorVariantNames(llvm::CallInst *, ArrayRef<std::string>): Assertion `VI && "Cannot add an invalid VFABI name."' failed.
`
since it couldn't demangle the mapping (since there is no vector name).

Is this change on purpose?

We had some similar problems a couple of years ago with
 https://reviews.llvm.org/D67572
which was then reverted and improved in
 https://reviews.llvm.org/D72734
so that vectorization would work even without a vector function name.


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


More information about the llvm-commits mailing list