[llvm] [TLI] Fix replace-with-veclib crash with invalid arguments (PR #77112)
Maciej Gabka via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 05:16:34 PST 2024
================
@@ -174,6 +176,24 @@ static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI,
Function *TLIFunc = getTLIFunction(I.getModule(), VectorFTy,
VD->getVectorFnName(), FuncToReplace);
+
+ // For calls, bail out when their arguments do not match with the TLI mapping.
----------------
mgabka wrote:
it feels to me like this should be called in the line 172, to double check if the reverse engineering based on VFABI worked well.
I think that we should be more specific in the comment message and explain why this is needed, what about:
"There is no guarantee that the vectorised instructions followed the VFABI specification when being created, this is why we need to add extra check to make sure that the operands of the vector function obtained via VFABI match the operands of the original vector instruction."
https://github.com/llvm/llvm-project/pull/77112
More information about the llvm-commits
mailing list