[PATCH] D116231: [InstCombine] (~a & ~b & c) | (~a & ~c & b) --> (b ^ c) & ~a

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 23 11:51:07 PST 2021


rampitec created this revision.
rampitec added a reviewer: spatel.
Herald added a subscriber: hiraditya.
rampitec requested review of this revision.
Herald added a project: LLVM.

and swapped `(~a | ~b | c) & (~a | ~c | b)` --> `~((b ^ c) & a)`.
This is the extension of handled case `(~(a | b) & c) | (~(a | c) & b)`
--> `(b ^ c) & ~a` with expression not being demorganed because
of mutiple uses of ~a and/or ~b.

The rest of the cases with the same LHS are guarded to use only
the original demorganed form for now.


https://reviews.llvm.org/D116231

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/test/Transforms/InstCombine/and-xor-or.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116231.396067.patch
Type: text/x-patch
Size: 48793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211223/ed7e2e1e/attachment.bin>


More information about the llvm-commits mailing list