[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)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 3 04:18:45 PST 2024


RKSimon 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 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?

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


More information about the llvm-commits mailing list