Files
clang-p2996/llvm/lib/Transforms/InstCombine
Yingwei Zheng 1220c9bafc [InstCombine] Fold the log2_ceil idiom (#76661)
This patch folds the `log2_ceil` idiom:
```
(BW - ctlz(A)) + (is_power2(A) ? 0 : 1) ->
zext(ctpop(A) >u/!= 1) + (ctlz(A, true) ^ (BW - 1)) (canonical form) ->
BW - ctlz(A - 1, false)
```

Alive2: https://alive2.llvm.org/ce/z/6mSbdi
2024-01-10 20:24:20 +08:00
..