[PATCH] D138401: [DAGCombiner] fold or (xor x, y),? patterns

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 06:17:32 PST 2022


bcl5980 marked an inline comment as done.
bcl5980 added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7008-7009
+  if (N0.getOpcode() == ISD::XOR) {
+    // fold or (xor x, y), x --> or x, y
+    //      or (xor x, y), (x and/or y) --> or x, y
+    SDValue N00 = N0.getOperand(0);
----------------
foad wrote:
> Should we also handle the commuted forms of the OR?
> or x, (xor x, y)
> or (x and/or y), (xor x, y)
We already handle these case. This code is in the function visitORCommutative. It will call twice with (N0, N1) and (N1, N0).


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

https://reviews.llvm.org/D138401



More information about the llvm-commits mailing list