[PATCH] D132784: [AArch64][TTI] Set the cost of XTN to 1 for 2xi64 (to 2xi32) and 8xi16 (to8xi8).

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 17:18:34 PDT 2022


mingmingl planned changes to this revision.
mingmingl added a comment.

https://reviews.llvm.org/D132889 sweeps tests in `llvm/test/Analysis/CostModel/AArch64` by adding aarch64-le target layout and updating tests -> only `cast.ll` and `arith-overflow.ll` stand out.

Given the split approach <https://github.com/llvm/llvm-project/blob/a11ec00afea327419ec1ab7c78ba6818d6c5bbf7/llvm/include/llvm/CodeGen/BasicTTIImpl.h#L1084-L1086> of BaseTTIImpl is used as a fallback when entry is not present in the table, it's likely that updating a few entries (as current patch does) to the correct number may still cause inaccuracies (in terms of how they are used in split approach and affecting the estimation of wider types).

Planning to add more entries (using https://gcc.godbolt.org/z/q8qodd147 as a template to get a better idea of codegen for different `trunc`), not sure if there is a minimum set of table entries that (works well with split approach and thereby) get all (at least all in `cast.ll`) combinations of `trunc` as accurate as possible.

Meanwhile would appreciate feedbacks on this plan! (assuming i'm on the right track to attribute cost to `trunc` for typical aarch64 data layout :) )


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

https://reviews.llvm.org/D132784



More information about the llvm-commits mailing list