@@ -313,33 +313,17 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
313313 Type *Ty = getContainedTypes (RetTy).front ();
314314 EVT VT = getTLI ()->getValueType (DL, Ty);
315315
316- EVT ScalarVT = VT.getScalarType ();
317316 RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
318317
319- // / Migration flag. IsVectorCall cases directly know about the vector
320- // / libcall in RuntimeLibcallsInfo and shouldn't try to use
321- // / LibInfo->getVectorMappingInfo.
322- bool IsVectorCall = false ;
323-
324318 switch (ICA.getID ()) {
325319 case Intrinsic::modf:
326- LC = RTLIB::getMODF (ScalarVT );
320+ LC = RTLIB::getMODF (VT );
327321 break ;
328322 case Intrinsic::sincospi:
329323 LC = RTLIB::getSINCOSPI (VT);
330- if (LC == RTLIB::UNKNOWN_LIBCALL)
331- LC = RTLIB::getSINCOSPI (ScalarVT);
332- else if (VT.isVector ())
333- IsVectorCall = true ;
334-
335324 break ;
336325 case Intrinsic::sincos:
337326 LC = RTLIB::getSINCOS (VT);
338- if (LC == RTLIB::UNKNOWN_LIBCALL)
339- LC = RTLIB::getSINCOS (ScalarVT);
340- else if (VT.isVector ())
341- IsVectorCall = true ;
342-
343327 break ;
344328 default :
345329 return std::nullopt ;
@@ -350,33 +334,14 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
350334 if (LibcallImpl == RTLIB::Unsupported)
351335 return std::nullopt ;
352336
353- StringRef LCName =
354- RTLIB::RuntimeLibcallsInfo::getLibcallImplName (LibcallImpl);
355-
356- // Search for a corresponding vector variant.
357- //
358- // FIXME: Should use RuntimeLibcallsInfo, not TargetLibraryInfo to get the
359- // vector mapping.
360337 LLVMContext &Ctx = RetTy->getContext ();
361- ElementCount VF = getVectorizedTypeVF (RetTy);
362- VecDesc const *VD = nullptr ;
363-
364- if (!IsVectorCall) {
365- for (bool Masked : {false , true }) {
366- if ((VD = LibInfo->getVectorMappingInfo (LCName, VF, Masked)))
367- break ;
368- }
369- if (!VD)
370- return std::nullopt ;
371- }
372338
373339 // Cost the call + mask.
374340 auto Cost =
375341 thisT ()->getCallInstrCost (nullptr , RetTy, ICA.getArgTypes (), CostKind);
376342
377- if ((VD && VD->isMasked ()) ||
378- (IsVectorCall &&
379- RTLIB::RuntimeLibcallsInfo::hasVectorMaskArgument (LibcallImpl))) {
343+ if (RTLIB::RuntimeLibcallsInfo::hasVectorMaskArgument (LibcallImpl)) {
344+ ElementCount VF = getVectorizedTypeVF (RetTy);
380345 auto VecTy = VectorType::get (IntegerType::getInt1Ty (Ctx), VF);
381346 Cost += thisT ()->getShuffleCost (TargetTransformInfo::SK_Broadcast, VecTy,
382347 VecTy, {}, CostKind, 0 , nullptr , {});
0 commit comments