[PATCH] D98210: [ARM] Add VREV MVE shuffle costs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 04:29:54 PST 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:1222
+
+    if (!Mask.empty()) {
+      std::pair<int, MVT> LT = TLI->getTypeLegalizationCost(DL, Tp);
----------------
RKSimon wrote:
> Why aren't you just using TTI::SK_Reverse?
Thanks for taking a look. A VREV is a little different from a SK_Reverse, as far as I understand, although for some of the tests it happens to match both. A vrev mask will reverse lanes in a block, not the whole register. So they have masks like <3, 2, 1, 0, 7, 6, 5, 4> or <1, 0, 3, 2, 5, 4, 7, 6>.

In MVE there are  vrev16.8, vrev32.8, vrev32.16, vrev64.8, vrev64.16 and vrev64.32. The way I think of them is that taking a 128 bit legal vector, they reverse the bits in the first number, then reverse back in the second.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98210/new/

https://reviews.llvm.org/D98210



More information about the llvm-commits mailing list