[PATCH] D65802: [DAGCombiner] Rebuild (setcc x, y, ==) from (xor (xor x, y), 1)

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 05:49:56 PDT 2019


rogfer01 marked an inline comment as done.
rogfer01 added inline comments.
Herald added a subscriber: pzheng.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13496-13499
+  // Transform (brcond (xor x, y)) -> (brcond (setcc, x, y, ne))
+  // Transform (brcond (xor (xor x, y), -1)) -> (brcond (setcc, x, y, eq))
+  if (N.getOpcode() == ISD::XOR && N->hasOneUse() &&
+      (*N->use_begin())->getOpcode() == ISD::BRCOND) {
----------------
lebedev.ri wrote:
> Why is this one-use restriction being introduced here?
There are two callers of this function `visitSETCC`, which passes a node generated by `SimplifySetCC`, and `visitBRCOND` which does indeed check that the passed node has just one use.

I'm less sure about the the node coming out of `SimplifySetCC` so it might make sense to err on the safe side here?


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

https://reviews.llvm.org/D65802





More information about the llvm-commits mailing list