This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Teach cost model masked gathers/scatters are cheap
ClosedPublic

Authored by MattDevereau on Aug 23 2021, 7:39 AM.

Details

Summary

Tell the cost model to use the scalable calculation for non-neon fixed vector. This results in a cheaper cost for fixed-length SVE masked gathers/scatters allowing the vectorizor to emit them more frequently.

Diff Detail

Event Timeline

MattDevereau created this revision.Aug 23 2021, 7:39 AM
MattDevereau requested review of this revision.Aug 23 2021, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2021, 7:39 AM
Matt added a subscriber: Matt.Aug 23 2021, 10:46 AM
efriedma added inline comments.Aug 23 2021, 11:50 AM
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
1593

"MaxNumElements / MaxNumElements"?

MattDevereau edited the summary of this revision. (Show Details)

[AArch64][SVE] Teach cost model masked SVE VLS gathers/scatters are cheap

Hi @MattDevereau, given we already have tests in Analysis/CostModel/AArch64/mem-op-cost-model.ll is it necessary to sve-gather-vls.ll and sve-scatter-vls.ll tests? I was thinking you could just add those to mem-op-cost-model.ll instead.

Hi @MattDevereau, given we already have tests in Analysis/CostModel/AArch64/mem-op-cost-model.ll is it necessary to sve-gather-vls.ll and sve-scatter-vls.ll tests? I was thinking you could just add those to mem-op-cost-model.ll instead.

Hi @david-arm, good point, it probably makes more sense to have them in there

Moved new tests into mem-op-cost-model.ll

david-arm accepted this revision.Aug 25 2021, 8:54 AM

LGTM! Thanks for making the changes.

This revision is now accepted and ready to land.Aug 25 2021, 8:54 AM