Skip to content

Commit 5e7bc5e

Browse files
authored
[DAGCombiner] Remove hasOneUse check from sext+sext_inreg to sext_inreg combine (#140207)
The hasOneUseCheck does not really add anything and makes the combine too restrictive. Upcoming patches benefit from removing the hasOneUse check.
1 parent 3aaf44f commit 5e7bc5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14117,7 +14117,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
1411714117
}
1411814118

1411914119
// If the trunc wasn't legal, try to fold to (sext_inreg (anyext x))
14120-
if ((!LegalTypes || TLI.isTypeLegal(VT)) && N0.hasOneUse()) {
14120+
if (!LegalTypes || TLI.isTypeLegal(VT)) {
1412114121
SDValue ExtSrc = DAG.getAnyExtOrTrunc(N00, DL, VT);
1412214122
return DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT, ExtSrc,
1412314123
N0->getOperand(1));

0 commit comments

Comments
 (0)