Skip to content

Commit

Permalink
[DAG] visitXOR - add missing comment for or/and constant setcc demorg…
Browse files Browse the repository at this point in the history
…an fold. NFC.

Noticed while triaging llvm#112347 which is using this fold - we described the or->and fold, but not the equivalent and->or which is also handled.
  • Loading branch information
RKSimon committed Oct 16, 2024
1 parent 467a9bd commit 25b702f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9594,6 +9594,7 @@ SDValue DAGCombiner::visitXOR(SDNode *N) {
}

// fold (not (or x, y)) -> (and (not x), (not y)) iff x or y are setcc
// fold (not (and x, y)) -> (or (not x), (not y)) iff x or y are setcc
if (isOneConstant(N1) && VT == MVT::i1 && N0.hasOneUse() &&
(N0Opcode == ISD::OR || N0Opcode == ISD::AND)) {
SDValue N00 = N0.getOperand(0), N01 = N0.getOperand(1);
Expand Down

0 comments on commit 25b702f

Please sign in to comment.