[llvm] BasicTTI: Cleanup multiple result intrinsic handling (PR #165970)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 1 09:05:35 PDT 2025
================
@@ -311,12 +310,45 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
!isVectorizedStructTy(cast<StructType>(RetTy)))
return std::nullopt;
+ Type *Ty = getContainedTypes(RetTy).front();
+ EVT VT = getTLI()->getValueType(DL, Ty);
+
+ EVT ScalarVT = VT.getScalarType();
+ RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
+
+ switch (ICA.getID()) {
+ case Intrinsic::modf:
+ LC = RTLIB::getMODF(ScalarVT);
+ break;
+ case Intrinsic::sincospi:
+ LC = RTLIB::getSINCOSPI(ScalarVT);
+ break;
+ case Intrinsic::sincos:
+ // TODO: Account for sincos_stret not always using a memory operation for
+ // the out argument
+ LC = RTLIB::getSINCOS_STRET(ScalarVT);
+
----------------
MacDue wrote:
I think it's wrong to use `SINCOS_STRET` here at all. There are currently no targets that have vector mappings for the stret version, so it does not make sense to factor that into trying to determine the vector cost.
I think the costs you're seeing are not for the stret versions are not generated by this function, as it'll bail out, as it only returns a cost if a vector mapping exists.
https://github.com/llvm/llvm-project/pull/165970
More information about the llvm-commits
mailing list