[llvm] 25b702f - [DAG] visitXOR - add missing comment for or/and constant setcc demorgan fold. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 03:23:05 PDT 2024
Author: Simon Pilgrim
Date: 2024-10-16T11:15:36+01:00
New Revision: 25b702f2637d5520cacf59e6a92e52956ccc7e8d
URL: https://github.com/llvm/llvm-project/commit/25b702f2637d5520cacf59e6a92e52956ccc7e8d
DIFF: https://github.com/llvm/llvm-project/commit/25b702f2637d5520cacf59e6a92e52956ccc7e8d.diff
LOG: [DAG] visitXOR - add missing comment for or/and constant setcc demorgan fold. NFC.
Noticed while triaging #112347 which is using this fold - we described the or->and fold, but not the equivalent and->or which is also handled.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 608ee8558e9928..0879165aac139d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -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);
More information about the llvm-commits
mailing list