[PATCH] D112955: [InstCombine] (~(a | b) & c) | ~(c | (a ^ b)) -> ~((a | b) & (c | (b ^ a)))
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 19 10:29:48 PST 2021
rampitec added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1782
+
+ // (~(A | B) & C) | ~(C | (A ^ B)) --> ~((A | B) & (C | (B ^ A)))
+ // (~(A & B) | C) & ~(C & (A ^ B)) --> (A ^ B ^ C) | ~(A | C)
----------------
spatel wrote:
> Both "A | B" and "(A ^ B) | C" are existing values in this expression. Does it not make sense to capture those instead of cloning them?
>
> Note: that also means we're only creating 2 instructions total ('and' + 'not'), so this transform only needs a single one-use constraint.
Thanks! A good catch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112955/new/
https://reviews.llvm.org/D112955
More information about the llvm-commits
mailing list