[PATCH] D98206: [TTI] Add a Mask to getShuffleCost

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


dmgreen added a comment.

Hello. A VREV is a little different from a SK_Reverse, as far as I understand. 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 digit, then reverse back in the second.

This seemed like the most general way to fix it to me, giving the backend the exact shuffle mask where available can help it provide better info. Adding a collection of SK_VREVXY might work, but I was hoping to add some other shuffles cheap for the Arm backend like VMOVN's, which would make further use of it eventually.


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

https://reviews.llvm.org/D98206



More information about the llvm-commits mailing list