From: Simon Pilgrim Date: Thu, 13 Jul 2017 09:39:00 +0000 (+0000) Subject: Use isNullConstantOrNullSplatConstant helper. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e20776d074e1def6f06962632814615fe647a98;p=llvm Use isNullConstantOrNullSplatConstant helper. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307895 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 71382c18fdf..8a1c09693b7 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3889,9 +3889,8 @@ SDValue DAGCombiner::visitAND(SDNode *N) { // Note: the SimplifyDemandedBits fold below can make an information-losing // transform, and then we have no way to find this better fold. if (N1C && N1C->isOne() && N0.getOpcode() == ISD::SUB) { - ConstantSDNode *SubLHS = isConstOrConstSplat(N0.getOperand(0)); - SDValue SubRHS = N0.getOperand(1); - if (SubLHS && SubLHS->isNullValue()) { + if (isNullConstantOrNullSplatConstant(N0.getOperand(0))) { + SDValue SubRHS = N0.getOperand(1); if (SubRHS.getOpcode() == ISD::ZERO_EXTEND && SubRHS.getOperand(0).getScalarValueSizeInBits() == 1) return SubRHS;