llvm-project
57927e9f - [InstCombine] Restrict `foldBitCeil` to power-of-two integer widths (#173849)

Commit
2 days ago
[InstCombine] Restrict `foldBitCeil` to power-of-two integer widths (#173849) The masking rewrite in `foldBitCeil` assumes a power-of-two bitwidth. For non-power-of-two integer types, `(-ctlz) & (BitWidth - 1)` is not equivalent to `BitWidth - ctlz` and can miscompile. This patch restricts the transform to power-of-two bitwidths. Alive2 proof: https://alive2.llvm.org/ce/z/i2E6zT Fixes #173787
Author
Parents
Loading