This is an archive of the discontinued LLVM Phabricator instance.

[Analysis][AArch64] Add on overhead costs for fixed-width gathers and scatters
AbandonedPublic

Authored by david-arm on Dec 6 2021, 4:56 AM.

Details

Summary

This patches increases the cost of fixed-width gathers and scatters that
will end up scalarising anyway. When SVE is enabled the vectoriser will currently
still often favour fixed-width vectorisation for AArch64 with gathers and
scatters even when the scalar loop is actually faster.

Diff Detail

Event Timeline

david-arm created this revision.Dec 6 2021, 4:56 AM
david-arm requested review of this revision.Dec 6 2021, 4:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2021, 4:56 AM
david-arm updated this revision to Diff 392303.Dec 7 2021, 1:00 AM
  • Rebase.

This patches increases the cost of fixed-width gathers and scatters that will end up scalarising anyway.

Do you know if isLegalMaskedGather/Scatter is returning true for these gathers that will jut be scalarized? It can be difficult at times to make isLegalMaskedGather very precise.

This patches increases the cost of fixed-width gathers and scatters that will end up scalarising anyway.

Do you know if isLegalMaskedGather/Scatter is returning true for these gathers that will jut be scalarized? It can be difficult at times to make isLegalMaskedGather very precise.

Yeah the problem is that currently the vectoriser only passes the element type to isLegalMaskedGather/Scatter and isLegalMaskedLoad/Store. So we have no way to distinguish between fixed-width and scalable except via the cost model. I think we would also like to fix that at some point, but in the short term this simple cost model change helps.

david-arm abandoned this revision.Dec 16 2021, 7:41 AM