isKnownToBeAPowerOfTwo: (X & Y) + Y is a power of 2 or zero if y is also.
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 18 May 2013 19:30:37 +0000 (19:30 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 18 May 2013 19:30:37 +0000 (19:30 +0000)
commitcb9d4667b7159944598c178dbb6568bc20ae069b
tree8aec7cbe5952aef278045a8fbfb5600103558ce6
parent688b5103eb4b70410d1ea54bcd8df4ef2f2ff8e8
isKnownToBeAPowerOfTwo: (X & Y) + Y is a power of 2 or zero if y is also.

This is useful if something that looks like (x & (1 << y)) ? 64 : 32 is
the divisor in a modulo operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182200 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Transforms/InstCombine/rem.ll