[llvm] [DAG] visitCTPOP - if only the upper half of the ctpop operand is zero then see if its profitable to only count the lower half. (PR #80473)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 3 05:31:05 PST 2024


phoebewang wrote:

> > Do we still need [275729a](https://github.com/llvm/llvm-project/commit/275729ae06d568e9589392c142a416fb8c2bb1a8) with this change?
> 
> Yes, I've also further extended it with [3a75807](https://github.com/llvm/llvm-project/commit/3a758076f54d521d20e32856a62c7d24803ee9e8) - I did consider doing something similar here in DAGCombine if shifting down the bits would allow a smaller CTPOP instruction, but decided against it - it might still be useful in legalization though?

Do you mean with https://github.com/llvm/llvm-project/commit/3a758076f54d521d20e32856a62c7d24803ee9e8, we still need to customize i16/32/64 so that doesn't matter?

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


More information about the llvm-commits mailing list