[PATCH] D142456: [AArch64][CostModel]: Add costs for zero/sign extend.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 05:19:03 PST 2023


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2066
+    // where each operation has a cost of 1.
+    { ISD::ZERO_EXTEND, MVT::nxv16i16, MVT::nxv16i8, 3},
+    { ISD::ZERO_EXTEND, MVT::nxv16i32, MVT::nxv16i8, 6},
----------------
hassnaa-arm wrote:
> david-arm wrote:
> > I think perhaps this can just be a cost of 2 because there are only 2 unpacks needed? Same for the SIGN_EXTEND case.
> Needed instructions are 2 unpacks and 1 mov, that's why I made it 3.
In this case the `mov` is inserted by the register allocator and isn't caused by lowering of the extend itself, so this should still have a cost of '2'.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142456



More information about the llvm-commits mailing list