[llvm] [RISCV][CostModel] add cost for cttz/ctlz under the non-zvbb (PR #117515)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 07:42:25 PST 2024


preames wrote:

> Do we still want to be using the intrinsic cost table for vector instructions? IIUC this was added before we started taking into account LMUL costs. Should we be migrating away from this eventually? cc @preames

Probably not long term, but this seems like it's a significant improvement regardless.  It doesn't scale with LMUL, but getting the m1 cost closer to correct when it's this far off seems quite worthwhile.  

Looking at it, it seems everything in the cost table is a per-element operation, and thus cost likely scales linearly with LMUL.  While we probably should switch to the getRISCVInstructionCost, merely multiplying by LMUL might be a easy step in the right direction.  

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


More information about the llvm-commits mailing list