[PATCH] D132730: [AARCH64][COST] Improve cost of reverse shuffles for AArch64

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 01:37:12 PDT 2022


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2952
       // Reverse can be lowered with `rev`.
-      { TTI::SK_Reverse, MVT::v2i32, 1 }, // mov.
       { TTI::SK_Reverse, MVT::v4i32, 2 }, // REV64; EXT
----------------
Miss_Grape wrote:
> Why not set the scene for N X Ty < 64? 
> eg: {TTI::SK_Reverse, MVT::v2i16, 1}
> @David Greene
Hello. I don't have that many e's in my name, but I presume you meant me :)

This table acts upon legal types, through LT.second in the call to CostTableLookup. That means a v2i16 will be treated as a v2i32 (extending the i16's into the upper halves of each of the i32's), and should see a low cost of 1 because of it.

If you think the costs are wrong and need adjusting, they might need to be handled separately from this table.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132730



More information about the llvm-commits mailing list