[llvm] [InstCombine] Reduce range of ctpop for non zero argument (PR #100899)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 17:12:01 PDT 2024


dtcxzyw wrote:

> This seems to cause miscompiles for one of our Arm targets. Here's the reproducer: https://godbolt.org/z/689eKhcnh
> 
> The problem seems to be the range attribute that doesn't contain "0" even though smax could return 0 in this case. This then combines with https://github.com/llvm/llvm-project/pull/111998/files which causes incorrect value of b on Arm machines.

The result looks OK? https://godbolt.org/z/T5E1oYvse
`bit_ceil(0) = 1, is_power_of_two(0) = 0`


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


More information about the llvm-commits mailing list