[flang-commits] [flang] [llvm] [LoopIdiom] Recognize naive popcount loop pattern (PR #172677)

Kang-Che Sung 宋岡哲 via flang-commits flang-commits at lists.llvm.org
Sun Dec 21 00:47:38 PST 2025


Explorer09 wrote:

Another naive popcount:

```c
int popcount_naive3(unsigned long x) {
    int result = 0;
    while (x != 0) {
        result += ((x & 1U) != 0);
        x >>= 1;
    }
    return result;
}
```

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


More information about the flang-commits mailing list