[PATCH] D118256: [AArch64] Fix costs of float vector compare/selects pairs.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 01:56:25 PST 2022


dmgreen added a comment.

This sounds OK. I went down a bit of a rabbit hole though.

- An FCMP_UNE will be cheap too.
- The other fcmp operators are not much more expensive, and it is the compare that takes 2 compares and an Or - you can argue that the select is still cheap.
- With `fast` the others are cheap too.
- A default cost of 13 for a vselect seems quite high to me. Given a mask (as vector compares generate on AArch64), the cost of a select will usually be a bif/bic/bsl. (In the not super distant past they would be and's and nots and ors, but things are generally better since then). If the compare isn't operating on elements of the same size as the select, the mask may need to be extended or truncated first though.
- Does this account for times when the compare and select type sizes do not match? That becomes harder to get correct.

Most of that would be better left for other patches though (if it turns out to be useful at-all!)
I would guess that FCMP_UNE are worth adding here, at least.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118256



More information about the llvm-commits mailing list