[PATCH] D140851: [Patch 3/4]: Add cases for assume (X & Y != {0|Y})

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 11:22:05 PST 2023


goldstein.w.n created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If X or Y is known to be a non-zero power of 2 we can prove the known
bit.

I.e assume X is a variable and Y is a power of 2 constants.

1. assume(X & Y == 0) -> Known(X).Zeros[Log2(Y)] = 1

2. assume(X & Y == Y) -> Known(X).Ones[Log2(Y)] = 1


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140851

Files:
  llvm/lib/Analysis/AssumptionCache.cpp
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/test/Transforms/InstCombine/icmp-binop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140851.485876.patch
Type: text/x-patch
Size: 23749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230102/aedf4a86/attachment.bin>


More information about the llvm-commits mailing list