[llvm] [AArch64][CostModel] Model sve costs for ctpop (PR #192428)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 06:43:07 PDT 2026


================

----------------
paulwalker-arm wrote:

This only covers the 128-bit vector case?  When passed a 256-bit vector and using -msve-vector-bits=256 the constructed `ScalableVT` will be twice the size of legal and the lookup will fail.

You'll want something like `MTy = MVT::getScalableVectorVT(MTy.getVectorElementType(), 128 / MTy.getScalarSizeInBits())`. This should also remove the need for the extra `CtpopCostTbl` lookup and `MTy.getScalarSizeInBits() == RetTy->getScalarSizeInBits()` restriction.

https://github.com/llvm/llvm-project/pull/192428


More information about the llvm-commits mailing list