[DAG] reassociateOpsCommutative - test getNode result directly. NFC
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 11 Nov 2021 14:13:33 +0000 (14:13 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 11 Nov 2021 18:45:50 +0000 (18:45 +0000)
Matches the clean code style we use directly above

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 0c7db29..a474967 100644 (file)
@@ -1076,10 +1076,9 @@ SDValue DAGCombiner::reassociateOpsCommutative(unsigned Opc, const SDLoc &DL,
     if (N0.hasOneUse()) {
       // Reassociate: (op (op x, c1), y) -> (op (op x, y), c1)
       //              iff (op x, c1) has one use
-      SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N00, N1);
-      if (!OpNode.getNode())
-        return SDValue();
-      return DAG.getNode(Opc, DL, VT, OpNode, N01);
+      if (SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N00, N1))
+        return DAG.getNode(Opc, DL, VT, OpNode, N01);
+      return SDValue();
     }
   }
   return SDValue();