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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 19 04:56:20 PST 2021


spatel 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)
----------------
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.


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

https://reviews.llvm.org/D112955



More information about the llvm-commits mailing list