This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add MVE add.sat costs
ClosedPublic

Authored by dmgreen on Jan 19 2021, 2:49 AM.

Details

Summary

This adds some basic MVE sadd_sat/ssub_sat/uadd_sat/usub_sat costs, based on when the instruction is legal. With smaller than legal types that are promoted we generate shr(qadd(shl, shl)), so the cost is 4 appropriately.

Diff Detail

Event Timeline

dmgreen created this revision.Jan 19 2021, 2:49 AM
dmgreen requested review of this revision.Jan 19 2021, 2:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 2:49 AM
SjoerdMeijer accepted this revision.Jan 19 2021, 5:48 AM

Looks reasonable.

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1532

Nit: early break:

if (!ST->hasMVEIntegerOps())
  break;
This revision is now accepted and ready to land.Jan 19 2021, 5:48 AM
This revision was automatically updated to reflect the committed changes.