Skip to content

Commit 53e83af

Browse files
committed
[DAG] getTruncatedUSUBSAT - always truncate operands. NFCI.
As noticed on D96703, we're always truncating the operands so should use getNode(ISD::TRUNCATE) instead of getZExtOrTrunc.
1 parent fc97a63 commit 53e83af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,8 +3153,8 @@ static SDValue getTruncatedUSUBSAT(EVT DstVT, EVT SrcVT, SDValue LHS,
31533153
DstVT.getScalarSizeInBits()),
31543154
DL, SrcVT);
31553155
RHS = DAG.getNode(ISD::UMIN, DL, SrcVT, RHS, SatLimit);
3156-
RHS = DAG.getZExtOrTrunc(RHS, DL, DstVT);
3157-
LHS = DAG.getZExtOrTrunc(LHS, DL, DstVT);
3156+
RHS = DAG.getNode(ISD::TRUNCATE, DL, DstVT, RHS);
3157+
LHS = DAG.getNode(ISD::TRUNCATE, DL, DstVT, LHS);
31583158
return DAG.getNode(ISD::USUBSAT, DL, DstVT, LHS, RHS);
31593159
}
31603160

0 commit comments

Comments
 (0)