Skip to content
Commit 413c119c authored by Noah Goldstein's avatar Noah Goldstein
Browse files

[InstCombine] If there is a known-bit transform is_pow2 check to just check for any other bits

in `ctpop(X) eq/ne 1` or `ctpop(X) ugt/ule 1`, if there is any
known-bit in `X`, instead of going through `ctpop`, we can just test
if there are any other known bits in `X`. If there are, `X` is not a
power of 2. If there aren't, `X` is a power of 2.

https://alive2.llvm.org/ce/z/eLMJgU

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D152677
parent 5ca14d43
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment