Skip to content

Commit 35be4a7

Browse files
committed
[SelectionDAG] Remove unecessary null check after call to getNode. NFC
As far as I know getNode will never return a null SDValue. I'm guessing this was modeled after the FoldConstantArithmetic call earlier. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D123550
1 parent 678ef2f commit 35be4a7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,9 +1070,8 @@ SDValue DAGCombiner::reassociateOpsCommutative(unsigned Opc, const SDLoc &DL,
10701070
if (TLI.isReassocProfitable(DAG, N0, N1)) {
10711071
// Reassociate: (op (op x, c1), y) -> (op (op x, y), c1)
10721072
// iff (op x, c1) has one use
1073-
if (SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N00, N1))
1074-
return DAG.getNode(Opc, DL, VT, OpNode, N01);
1075-
return SDValue();
1073+
SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N00, N1);
1074+
return DAG.getNode(Opc, DL, VT, OpNode, N01);
10761075
}
10771076
}
10781077

0 commit comments

Comments
 (0)