Skip to content

Commit 41eac8f

Browse files
committed
fix: review
1 parent a624583 commit 41eac8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9902,14 +9902,14 @@ SDValue DAGCombiner::visitXOR(SDNode *N) {
99029902
if (SDValue Combined = visitADDLike(N))
99039903
return Combined;
99049904

9905-
// fold xor (setcc x y cc) -1 -> setcc x y !cc
9906-
// Avoid breaking: and (xor (setcc x y cc) -1) z -> andn for vec
9905+
// fold not (setcc x, y, cc) -> setcc x y !cc
9906+
// Avoid breaking: and (not(setcc x, y, cc), z) -> andn for vec
99079907
unsigned N0Opcode = N0.getOpcode();
99089908
SDValue LHS, RHS, CC;
99099909
if (TLI.isConstTrueVal(N1) &&
99109910
isSetCCEquivalent(N0, LHS, RHS, CC, /*MatchStrict*/ true) &&
9911-
!(N->hasOneUse() && TLI.hasAndNot(SDValue(N, 0)) &&
9912-
N->use_begin()->getUser()->getOpcode() == ISD::AND && VT.isVector())) {
9911+
!(VT.isVector() && TLI.hasAndNot(SDValue(N, 0)) && N->hasOneUse() &&
9912+
N->use_begin()->getUser()->getOpcode() == ISD::AND)) {
99139913
ISD::CondCode NotCC = ISD::getSetCCInverse(cast<CondCodeSDNode>(CC)->get(),
99149914
LHS.getValueType());
99159915
if (!LegalOperations ||

0 commit comments

Comments
 (0)