[PATCH] D132784: [AArch64][TTI] Add cost table entry for trunc over vector of integers.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 08:35:30 PDT 2022


mingmingl added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1611
+    // FIXME: v4i64 -> v4i8 should be optimized to 1 uzp1 + 1 xtn
+    {ISD::TRUNCATE, MVT::v4i8, MVT::v4i64, 3},
+    {ISD::TRUNCATE, MVT::v4i16, MVT::v4i32, 1},   // xtn
----------------
dmgreen wrote:
> It looks like it is already 2 here: https://godbolt.org/z/T4rTqf1Tx. I guess it is not very reliable at the moment.
I filed https://github.com/llvm/llvm-project/issues/57502 to track this difference and took the liberty to update this number to 2 in this patch.

Re-format the table entries so columns are aligned -> only <4 x i64> -> <4 x i8> entry is updated in `cast.ll` as a result of this entry update, compared with reviewed version.

Please let me know if it's more idiomatic to use the higher one (when the codegen is not very reliable and the diff is small). Will hold this patch for a few more days and possibly commit on next Monday if the change from 3 to 2 looks good. 

Thanks for reviews!


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

https://reviews.llvm.org/D132784



More information about the llvm-commits mailing list