[llvm] [AArch64][CostModel] Fix stale costs for "ctpop" Intrinsic (PR #191769)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 02:39:29 PDT 2026
davemgreen wrote:
> Latter. To align with the produced codegen.
OK, sounds good. See https://davemgreen.github.io/codesize.html?from=thru&instr=ctpop for the list of all the instructions. (We have slowly been going through them all, but some are deliberately wrong and some cause regressions in real world code when changed. This one should be fine).
I would expect the scalar cost, for the most part, to be `getVectorInstrCost(insert) + cost-of-64bit-vector-ctpop + getVectorInstrCost(extract). There might be some differences but it should then automatically pick up the different cost of vector instructions where different features are available, and give a higher cost to the expensive cross register bank copies. It might increase the throughput cost of ctpop, but that should be OK given it will just lead to more vectorization.
https://github.com/llvm/llvm-project/pull/191769
More information about the llvm-commits
mailing list