This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Cost modelling for fptoi_sat
ClosedPublic

Authored by dmgreen on Apr 24 2022, 11:12 PM.

Details

Summary

This builds on top of the target-independent cost model added in D124269 to add aarch64 specific costs for fptoui_sat and fptosi_sat intrinsics. For many common types they will be legal instructions as the AArch64 instructions will saturate naturally. For unsupported pairs of integer and floating point types, an additional min/max clamp is needed.

Diff Detail

Event Timeline

dmgreen created this revision.Apr 24 2022, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 11:12 PM
dmgreen requested review of this revision.Apr 24 2022, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 11:12 PM
samtebbs accepted this revision.Apr 26 2022, 7:58 AM

Looks pretty sensible to me, thanks.

This revision is now accepted and ready to land.Apr 26 2022, 7:58 AM
This revision was landed with ongoing or failed builds.May 2 2022, 3:36 AM
This revision was automatically updated to reflect the committed changes.
efriedma added inline comments.
llvm/test/Analysis/CostModel/AArch64/fptoi_sat.ll
325

Any idea what's going on with this "400"? Even with our current terrible unrolled codegen, it's still only 50 instructions.