[llvm] Fix scalar overload name constructed by ReplaceWithVeclib.cpp (PR #111095)

Maciej Gabka via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 02:25:43 PDT 2024


================
@@ -100,20 +100,39 @@ static void replaceWithTLIFunction(IntrinsicInst *II, VFInfo &Info,
 static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI,
                                     IntrinsicInst *II) {
   assert(II != nullptr && "Intrinsic cannot be null");
-  // At the moment VFABI assumes the return type is always widened unless it is
-  // a void type.
-  auto *VTy = dyn_cast<VectorType>(II->getType());
-  ElementCount EC(VTy ? VTy->getElementCount() : ElementCount::getFixed(0));
+  Intrinsic::ID IID = II->getIntrinsicID();
+  if (IID == Intrinsic::not_intrinsic)
+    return false;
----------------
mgabka wrote:

Ah I see, the casting method uses  just  ```bool isIntrinsic() const``` which only checks if the name starts with the llvm. and is not checking if there is intrinsic ID, while there seems to be tests using llvm. functions which aren't intrinsics.

That is a but in the top level function in this pass, could you move this extra check to runImpl function so we have all the filtering in one place?

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


More information about the llvm-commits mailing list