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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 05:56:34 PST 2022


foad 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);
----------------
Should we also handle the commuted forms of the OR?
or x, (xor x, y)
or (x and/or y), (xor x, y)


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

https://reviews.llvm.org/D138401



More information about the llvm-commits mailing list