This is an archive of the discontinued LLVM Phabricator instance.

[CostModel]Add cost model for experimental.vector.reverse
ClosedPublic

Authored by CarolineConcatto on Jan 28 2021, 2:02 AM.

Details

Summary

This patch uses the function getShuffleCost with SK_Reverse to compute the cost
for experimental.vector.reverse.
For scalable vector type, it adds a table will the legal types on
AArch64TTIImpl::getShuffleCost to not assert in BasicTTIImpl::getShuffleCost,
and for fixed vector, it relies on the existing cost model in BasicTTIImpl.

Depends on D94883

Diff Detail

Event Timeline

CarolineConcatto requested review of this revision.Jan 28 2021, 2:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2021, 2:02 AM
david-arm added inline comments.Jan 28 2021, 5:50 AM
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
1244

I think we need an entry for MVT::nxv8bf16 here too.

llvm/test/Analysis/CostModel/AArch64/getIntrinsicInstrCost-vector-reverse.ll
11

Same suggestion as I left in D95598 about reducing number of functions and CHECK lines, but feel free to ignore it if you prefer the tests this way!

  • add support for nxv8bf16 and simplify .ll test
CarolineConcatto marked 2 inline comments as done.Jan 29 2021, 9:16 AM

Thank you @david-arm for the test suggestion.
I also added the support for nxv8bf16.

david-arm accepted this revision.Feb 1 2021, 1:44 AM

LGTM!

This revision is now accepted and ready to land.Feb 1 2021, 1:44 AM
This revision was landed with ongoing or failed builds.Feb 15 2021, 6:25 AM
This revision was automatically updated to reflect the committed changes.