Skip to content

Commit

Permalink
[DAG] reassociateOpsCommutative - test getNode result directly. NFC
Browse files Browse the repository at this point in the history
Matches the clean code style we use directly above
  • Loading branch information
RKSimon committed Nov 11, 2021
1 parent 8188484 commit 010b09b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 010b09b

Please sign in to comment.