]> granicus.if.org Git - llvm/commitdiff
Use isNullConstantOrNullSplatConstant helper. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 Jul 2017 09:39:00 +0000 (09:39 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 Jul 2017 09:39:00 +0000 (09:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307895 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 71382c18fdf9d667a255dd51e892e8428598ac83..8a1c09693b746f31d7dd6b4486d82092b210c08f 100644 (file)
@@ -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;