@@ -316,8 +316,6 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
316316 EVT ScalarVT = VT.getScalarType ();
317317 RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
318318
319- bool UsesMemoryOutArgument = true ;
320-
321319 switch (ICA.getID ()) {
322320 case Intrinsic::modf:
323321 LC = RTLIB::getMODF (ScalarVT);
@@ -326,13 +324,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
326324 LC = RTLIB::getSINCOSPI (ScalarVT);
327325 break ;
328326 case Intrinsic::sincos:
327+ // TODO: Account for sincos_stret not always using a memory operation for
328+ // the out argument
329329 LC = RTLIB::getSINCOS_STRET (ScalarVT);
330- UsesMemoryOutArgument = false ;
331330
332- if (getTLI ()->getLibcallImpl (LC) == RTLIB::Unsupported) {
331+ if (getTLI ()->getLibcallImpl (LC) == RTLIB::Unsupported)
333332 LC = RTLIB::getSINCOS (ScalarVT);
334- UsesMemoryOutArgument = true ;
335- }
336333
337334 break ;
338335 default :
@@ -367,11 +364,6 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
367364 VecTy, {}, CostKind, 0 , nullptr , {});
368365 }
369366
370- // Technically this depends on the ABI, but assume sincos_stret passes in
371- // registers.
372- if (!UsesMemoryOutArgument)
373- return Cost;
374-
375367 // Lowering to a library call (with output pointers) may require us to emit
376368 // reloads for the results.
377369 for (auto [Idx, VectorTy] : enumerate(getContainedTypes (RetTy))) {
0 commit comments