DAGCombiner: Generate a correct constant for vector types when folding (xor (and)) into (and (not)).
PR15948.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181597 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 700ee12..c54dffb 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3464,8 +3464,7 @@
if (N0.getOpcode() == ISD::AND && N0.getNode()->hasOneUse() &&
N0->getOperand(1) == N1) {
SDValue X = N0->getOperand(0);
- SDValue NotX = DAG.getNode(ISD::XOR, X.getDebugLoc(), VT, X,
- DAG.getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT));
+ SDValue NotX = DAG.getNOT(X.getDebugLoc(), X, VT);
AddToWorkList(NotX.getNode());
return DAG.getNode(ISD::AND, N->getDebugLoc(), VT, NotX, N1);
}