Use `analyzeKnownBitsFromAndXorOr` in `SimplifyDemandedUseBits` for and/xor/or
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 23 Feb 2023 19:50:02 +0000 (13:50 -0600)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Fri, 24 Feb 2023 01:52:17 +0000 (19:52 -0600)
commit4fcfff4f2de048cdf1d2d2180534b8cf9207cebd
tree3cff28dd7725996ae61cfbab9e42895e19637143
parent196d3e39653c66b6809680e2ae725f7a688f672f
Use `analyzeKnownBitsFromAndXorOr` in `SimplifyDemandedUseBits` for and/xor/or

There are extra patterns that have for these three logic operations
that aren't covered in `SimplifyDemandedUseBits`. To avoid duplicating
the code, just use `analyzeKnownBitsFromAndXorOr` in
`SimplifyDemandedUseBits` to get full coverage.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D142429
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/test/Analysis/ValueTracking/knownbits-and-or-xor-lowbit.ll
llvm/test/Analysis/ValueTracking/knownbits-bmi-pattern.ll
llvm/test/Transforms/InstCombine/ctpop-pow2.ll