Skip to content

Commit d915d6b

Browse files
committed
[DAGCombiner] Remove code for optimizing select (xor Cond, 0), X, Y -> select Cond, X, Y. Just let combine on the xor itself take care of it.
llvm-svn: 291534
1 parent f45ecd6 commit d915d6b

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5470,17 +5470,13 @@ SDValue DAGCombiner::visitSELECT(SDNode *N) {
54705470
}
54715471

54725472
// select (xor Cond, 1), X, Y -> select Cond, Y, X
5473-
// select (xor Cond, 0), X, Y -> selext Cond, X, Y
54745473
if (VT0 == MVT::i1) {
54755474
if (N0->getOpcode() == ISD::XOR) {
54765475
if (auto *C = dyn_cast<ConstantSDNode>(N0->getOperand(1))) {
54775476
SDValue Cond0 = N0->getOperand(0);
54785477
if (C->isOne())
54795478
return DAG.getNode(ISD::SELECT, SDLoc(N), N1.getValueType(),
54805479
Cond0, N2, N1);
5481-
else
5482-
return DAG.getNode(ISD::SELECT, SDLoc(N), N1.getValueType(),
5483-
Cond0, N1, N2);
54845480
}
54855481
}
54865482
}

0 commit comments

Comments
 (0)