This is an archive of the discontinued LLVM Phabricator instance.

[AIC] Fix the sext cost operands in tryToFPToSat
ClosedPublic

Authored by dmgreen on Jul 10 2023, 6:21 AM.

Details

Summary

As pointed out in D125755 the operand of a call to getCastInstrCost had the Src and Dst the wrong way around.

This fixes that, but alters one of the tests in a way that may not be profitable, possibly due to inaccuracies in the costmodel for X86 fptosi.sat instructions that are scalarized? https://godbolt.org/z/cnKzzTKcr

Diff Detail

Event Timeline

dmgreen created this revision.Jul 10 2023, 6:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2023, 6:21 AM
dmgreen requested review of this revision.Jul 10 2023, 6:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2023, 6:21 AM
dmgreen edited the summary of this revision. (Show Details)Jul 10 2023, 6:22 AM

I'm not certain its the costmodel - the generic expanded cost in BasicTTIImplBase looks about right - the problem seems to be the backend scalarizing when it shouldn't need to.

RKSimon added a subscriber: e-kud.Jul 24 2023, 5:58 AM

@e-kud is looking at the poor x86 codegen for fptosi/ui.sat here - D150372

That does look like quite an improvement! Thanks

dnsampaio accepted this revision.Jul 28 2023, 8:52 AM

Thanks for looking into this, this LGTM. I imagine it's best to wait the ok from @RKSimon as well for pushing.

This revision is now accepted and ready to land.Jul 28 2023, 8:52 AM
RKSimon accepted this revision.Aug 6 2023, 1:56 AM

LGTM - let's get this fix in now and I'll assist @e-kud getting D150372 done soon

This revision was landed with ongoing or failed builds.Aug 7 2023, 1:33 AM
This revision was automatically updated to reflect the committed changes.