[PATCH] D142271: [ValueTracking] Add KnownBits patterns `xor(x, x - 1)` and `and(x, -x)` for knowing upper bits to be zero

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 11:48:18 PST 2023


foad added a comment.

In D142271#4077955 <https://reviews.llvm.org/D142271#4077955>, @goldstein.w.n wrote:

> I see, yeah that makes sense although I would design it as a static API b.c we can technically get more information from `-x` or `x - 1` than `x` itself if it happens to match some assume.

Is that really going to happen in practice? To me it seems so unlikely as to be not worth worrying about, for the sake a a nice simple API.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142271/new/

https://reviews.llvm.org/D142271



More information about the llvm-commits mailing list